From 13b65fc3c0556e25a6325d4e6f3b69fdf748a54e Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 5 Dec 2023 14:59:21 +0100 Subject: [PATCH] Update errors messages --- packages/api/src/utils/client/httpClient.ts | 4 ++-- packages/api/src/utils/error.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/api/src/utils/client/httpClient.ts b/packages/api/src/utils/client/httpClient.ts index 39b9624a384c..cc91d8dc8136 100644 --- a/packages/api/src/utils/client/httpClient.ts +++ b/packages/api/src/utils/client/httpClient.ts @@ -244,9 +244,9 @@ export class HttpClient implements IHttpClient { if (isAbortedError(e)) { if (signalGlobal?.aborted || signalLocal?.aborted) { - throw new ErrorAborted(`request operationId=${definition.operationId}`); + throw new ErrorAborted(`${definition.operationId} request`); } else if (controller.signal.aborted) { - throw new TimeoutError(`request operationId=${definition.operationId}`); + throw new TimeoutError(`${definition.operationId} request`); } else { throw Error("Unknown aborted error"); } diff --git a/packages/api/src/utils/error.ts b/packages/api/src/utils/error.ts index 9c28cfae3551..b1cb2c54463c 100644 --- a/packages/api/src/utils/error.ts +++ b/packages/api/src/utils/error.ts @@ -3,7 +3,7 @@ export class ApiError extends Error { operationId?: string; constructor(message: string, status: number, operationId: string) { - super(`${message} status=${status}, operationId=${operationId}`); + super(`Request ${operationId} failed with status ${status}: ${message}`); this.operationId = operationId; this.status = status; }