Skip to content

Commit

Permalink
Improved error handling for live console for tool execution.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Nov 12, 2024
1 parent a2bffb8 commit 8063632
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion client/src/components/providers/JobProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@ async function jobConsoleOutput({
`${getAppRoot()}api/jobs/${jobId}/console_output?stdout_position=${stdout_position}&stdout_length=${stdout_length}` +
`&stderr_position=${stderr_position}&stderr_length=${stderr_length}`;
try {
const { data } = await axios.get(url);
const { status, data } = await axios.get(url, {
validateStatus: function (status) {
return status == 200 || status == 403;
},
});
if (status == 403) {
if (data.err_code == 403004) {
console.log("This job destination does not support console output");
return { state: "ok" };
}
throw Error("Problem fetching state");
}
return data;
} catch (e) {
rethrowSimple(e);
Expand Down

0 comments on commit 8063632

Please sign in to comment.