Skip to content

Commit

Permalink
fix: return error instead of failing on invalid job event
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Oct 12, 2018
1 parent ed80d1e commit fadebd5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/in-house-bot/lambda/job-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ lambda.use(async (ctx) => {
const { components } = ctx
const { logger } = components
if (!job.name) {
throw new Errors.InvalidInput(`job missing name: ${JSON.stringify(job)}`)
ctx.body = {
error: Errors.exportMini(new Errors.InvalidInput(`job missing name: ${JSON.stringify(job)}`))
}

return
}

logger.debug(`running job: ${job.name}`)
Expand Down

0 comments on commit fadebd5

Please sign in to comment.