Skip to content

Commit

Permalink
fix: Log uncaught exceptions in worker thread handlers (#1544)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenquimby authored Aug 21, 2022
1 parent 07cdd04 commit 498ce29
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,9 @@ export default class InProcessRunner {
},
}

let result

// execute (run) handler
try {
result = handler(event, lambdaContext, callback)
} catch {
throw new Error(`Uncaught error in '${this.#functionKey}' handler.`)
}
// no try/catch so that errors bubble up and are logged with root stack traces
const result = handler(event, lambdaContext, callback)

// // not a Promise, which is not supported by aws
// if (result == null || typeof result.then !== 'function') {
Expand Down

0 comments on commit 498ce29

Please sign in to comment.