From 85cd73779f9e9410aadf326b20f398083c07cadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Lidstr=C3=B6m?= Date: Fri, 2 Aug 2024 15:07:44 +0200 Subject: [PATCH] Include RestClient response code in thrown message --- shared/restclient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/restclient.ts b/shared/restclient.ts index 99eda20b..2b5972b5 100644 --- a/shared/restclient.ts +++ b/shared/restclient.ts @@ -101,7 +101,7 @@ export class RestClient { } return new Promise((resolve, reject) => { const dispatchError = (e: any, code?: number) => { - const s = `request error: ${ + const s = `request error: ${code ? code + " " : ""}${ typeof e === "string" ? e : JSON.stringify(e) }`; reject(new RestClientError(s, code || 500));