diff --git a/frontend/src/utils/Api.ts b/frontend/src/utils/Api.ts index 6d77b63..90bb20c 100644 --- a/frontend/src/utils/Api.ts +++ b/frontend/src/utils/Api.ts @@ -53,7 +53,9 @@ export class ApiError extends Error { : await response.text(); return new ApiError( - `API ${method} request failed: ${path} => ${response.status} - ${body}`, + `API ${method} request failed: ${path} => ${ + response.status + } - ${JSON.stringify(body)}`, response.status, ApiErrorType.REQUEST_FAILED, body @@ -67,7 +69,9 @@ export class ApiError extends Error { json: JSONValue ): Promise { return new ApiError( - `API ${method} request result has unexpected type. ${path} => ${json}`, + `API ${method} request result has unexpected type. ${path} => ${JSON.stringify( + json + )}`, response.status, ApiErrorType.UNEXPECTED_RESULT_TYPE, json