We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65c1c20 commit 06aed4cCopy full SHA for 06aed4c
src/blueapi/blueapi.ts
@@ -74,8 +74,16 @@ export function submitPlan(
74
name: planName,
75
params: planParams,
76
})
77
- .then((res) => res.json().then((res) => res["task_id"]))
78
- .catch((error) => console.log(error));
+ .then((res) => {
+ if (!res.ok) {
79
+ throw new Error(
80
+ `Unable to POST request,response error ${res.statusText}`
81
+ );
82
+ }
83
+ res.json();
84
+ })
85
+ .then((res) => res["task_id"]); // This probably needs to be done separately or something
86
+ // .catch((error) => console.log(error));
87
}
88
89
export function submitAndRunPlanImmediately(
0 commit comments