await response errors

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2023-05-12 10:36:20 +02:00
parent c9d2917ccd
commit 7c116bcac7
4 changed files with 10 additions and 3 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch
'@backstage/config-loader': patch
'@backstage/plugin-auth-backend': patch
---
Fixed the way that some request errors are thrown
@@ -149,7 +149,7 @@ export class RemoteConfigSource implements ConfigSource {
signal: signal as import('node-fetch').RequestInit['signal'],
});
if (!res.ok) {
throw ResponseError.fromResponse(res);
throw await ResponseError.fromResponse(res);
}
const content = await res.text();
@@ -227,7 +227,7 @@ export class CloudflareAccessAuthProvider implements AuthProviderRouteHandlers {
{ headers },
);
if (!res.ok) {
throw ResponseError.fromResponse(res);
throw await ResponseError.fromResponse(res);
}
const cfIdentity = await res.json();
return cfIdentity as unknown as CloudflareAccessIdentityProfile;
@@ -88,7 +88,7 @@ export const getAndWriteAttachments = async (
},
});
if (!res.ok) {
throw ResponseError.fromResponse(res);
throw await ResponseError.fromResponse(res);
} else if (res.body !== null) {
fs.openSync(`${workspace}/${mkdocsDir}docs/img/${downloadTitle}`, 'w');
const writeStream = fs.createWriteStream(