Skip to content

Commit

Permalink
fix: add handler exception logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Aug 21, 2022
1 parent 310a535 commit 06d348d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lambda/handler-runner/HandlerRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ export default class HandlerRunner {
this.#runner = await this.#loadRunner()
}

return this.#runner.run(event, context)
try {
return await this.#runner.run(event, context)
} catch (err) {
log.error(
`Unhandled exception in handler '${this.#funOptions.functionKey}'.`,
)
throw err
}
}
}

0 comments on commit 06d348d

Please sign in to comment.