From 1f3b7099fec9db5a2668d614453bb2c634c73cb8 Mon Sep 17 00:00:00 2001 From: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:05:58 -0500 Subject: [PATCH] fix: Include the URL in the bitbucket API error message to make it easier to debug Signed-off-by: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com> --- src/bbstd/client.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bbstd/client.ts b/src/bbstd/client.ts index a2f6d38..e2b2f14 100644 --- a/src/bbstd/client.ts +++ b/src/bbstd/client.ts @@ -67,7 +67,9 @@ export class BitBucket { }); if (!response.ok) { const text = await response.text(); - throw new Error(`BitBucket API Error (${response.status}): ${text}`); + throw new Error( + `BitBucket API Error on URL ${url} (${response.status}): ${text}`, + ); } return response; } @@ -105,7 +107,9 @@ export class BitBucket { }); if (!response.ok) { const text = await response.text(); - throw new Error(`BitBucket API Error (${response.status}): ${text}`); + throw new Error( + `BitBucket API Error on url ${url} (${response.status}): ${text}`, + ); } return response; }