Skip to content

Commit

Permalink
Merge pull request backstage#8143 from backstage/freben/await-error
Browse files Browse the repository at this point in the history
Fixed missing `await` when throwing server side errors
  • Loading branch information
benjdlambert authored Nov 18, 2021
2 parents ddfdcd2 + 9f21236 commit 153eac4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/sharp-carrots-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@backstage/plugin-config-schema': patch
'@backstage/plugin-scaffolder': patch
---

Fixed a missing `await` when throwing server side errors
2 changes: 1 addition & 1 deletion plugins/config-schema/src/api/StaticSchemaLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class StaticSchemaLoader implements ConfigSchemaApi {
return undefined;
}

throw ResponseError.fromResponse(res);
throw await ResponseError.fromResponse(res);
}

return await res.json();
Expand Down
4 changes: 2 additions & 2 deletions plugins/scaffolder/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class ScaffolderClient implements ScaffolderApi {
});

if (!response.ok) {
throw ResponseError.fromResponse(response);
throw await ResponseError.fromResponse(response);
}

return await response.json();
Expand Down Expand Up @@ -302,7 +302,7 @@ export class ScaffolderClient implements ScaffolderApi {
});

if (!response.ok) {
throw ResponseError.fromResponse(response);
throw await ResponseError.fromResponse(response);
}

return await response.json();
Expand Down

0 comments on commit 153eac4

Please sign in to comment.