Migrate notebooks workspaces to generated clients (#876)

This commit is contained in:
Steve Faulkner
2021-06-09 13:08:10 -07:00
committed by GitHub
parent 8f6cac3d35
commit fc9f4c5583
13 changed files with 49 additions and 583 deletions

View File

@@ -144,13 +144,13 @@ async function getOperationStatus(operationStatusUrl: string) {
const body = await response.json();
const status = body.status;
if (!status && response.status === 200) {
return body;
}
if (status === "Canceled" || status === "Failed") {
const errorMessage = body.error ? JSON.stringify(body.error) : "Operation could not be completed";
const error = new Error(errorMessage);
throw new AbortError(error);
}
if (response.status === 200) {
return body;
}
throw new Error(`Operation Response: ${JSON.stringify(body)}. Retrying.`);
}