diff --git a/javascriptv3/example_code/glue/scenarios/basic/steps/start-job-run.js b/javascriptv3/example_code/glue/scenarios/basic/steps/start-job-run.js index 1cd27fc340e..5c953b6009d 100644 --- a/javascriptv3/example_code/glue/scenarios/basic/steps/start-job-run.js +++ b/javascriptv3/example_code/glue/scenarios/basic/steps/start-job-run.js @@ -23,15 +23,14 @@ const waitForJobRun = async (getJobRun, jobName, jobRunId) => { case "FAILED": case "TIMEOUT": case "STOPPED": + case "ERROR": throw new Error( `Job ${JobRun.JobRunState}. Error: ${JobRun.ErrorMessage}`, ); - case "RUNNING": - break; case "SUCCEEDED": return; default: - throw new Error(`Unknown job run state: ${JobRun.JobRunState}`); + break; } log(