Restore for scaffold()

Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
Oliver Sand
2021-05-06 18:28:41 +02:00
parent 15e248a107
commit d6ee183054
+3 -1
View File
@@ -159,7 +159,9 @@ export class ScaffolderClient implements ScaffolderApi {
});
if (response.status !== 201) {
throw ResponseError.fromResponse(response);
const status = `${response.status} ${response.statusText}`;
const body = await response.text();
throw new Error(`Backend request failed, ${status} ${body.trim()}`);
}
const { id } = (await response.json()) as { id: string };