Skip to content

Commit

Permalink
return error if parse request fails
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Dec 1, 2023
1 parent 7a027f2 commit 213ba64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routes/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1672,8 +1672,11 @@ The OpenDota API offers 50,000 free calls per month and a rate limit of 60 reque
function exitWithJob(err, parseJob) {
if (err) {
console.error(err);
return res.status(400).json({
error: err,
});
}
res.status(err ? 400 : 200).json({
return res.status(200).json({
job: {
jobId: parseJob && parseJob.id,
},
Expand Down

0 comments on commit 213ba64

Please sign in to comment.