Skip to content

Commit

Permalink
Fixed a missing await when throwing server side errors
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
  • Loading branch information
freben committed Nov 18, 2021
1 parent ddfdcd2 commit 9f21236
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 9f21236

Please sign in to comment.