wrap aws-sdk errors - (prettier update)
there are http errors with no message from aws-sdk, so the error is wrapped to conform to the @backstage/errors assertError checks Signed-off-by: Manuel Stein <manuel.stein@nokia-bell-labs.com>
This commit is contained in:
@@ -49,7 +49,9 @@ const streamToBuffer = (stream: Readable): Promise<Buffer> => {
|
||||
try {
|
||||
const chunks: any[] = [];
|
||||
stream.on('data', chunk => chunks.push(chunk));
|
||||
stream.on('error', (e: Error) => reject(new ForwardedError('Unable to read stream', e)));
|
||||
stream.on('error', (e: Error) =>
|
||||
reject(new ForwardedError('Unable to read stream', e)),
|
||||
);
|
||||
stream.on('end', () => resolve(Buffer.concat(chunks)));
|
||||
} catch (e) {
|
||||
throw new ForwardedError('Unable to parse the response data', e);
|
||||
|
||||
Reference in New Issue
Block a user