diff --git a/src/datastore.js b/src/datastore.js index 39db314..307c687 100644 --- a/src/datastore.js +++ b/src/datastore.js @@ -115,7 +115,15 @@ async function createJob(collabId, jobData, auth) { cache.jobs[collabId][createdJob.id] = createdJob; return "success"; } else { - throw new Error("job creation was not successful"); + let errorDetails = ""; + try { + const errors = await response.json(); + errorDetails = errors.detail; + } catch (err) { + console.log("Unable to get error details"); + console.log(err); + } + throw new Error("Job creation was not successful. " + errorDetails); } }