Skip to content

Commit

Permalink
Remove initial new line from error message (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfalke authored Sep 25, 2023
1 parent 3c0c93f commit 81b3dae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/libs/http-utils/src/FetchClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,14 @@ export abstract class FetchClient {
const { status, statusText } = response;
const { headers, method, url } = request;
const traceid = headers.get('traceid');
const fetchError = new FetchClientError(`
${status} ${statusText}: ${method.toUpperCase()} ${url}
${traceid != null ? 'Traceid: ' + traceid : ''}
const fetchError = new FetchClientError(
[
`${status} ${statusText}: ${method.toUpperCase()} ${url}`,
traceid != null ? 'Traceid: ' + traceid + '\n' : '',
await response.text(),
].join('\n')
);

${await response.text()}`);
this.onNonSuccessResponse?.(fetchError);
throw fetchError;
}
Expand Down

0 comments on commit 81b3dae

Please sign in to comment.