Merge pull request #17771 from backstage/freben/await

await response errors
This commit is contained in:
Fredrik Adelöw
2023-05-16 10:46:17 +02:00
committed by GitHub
4 changed files with 10 additions and 3 deletions
@@ -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(