Skip to content

Commit

Permalink
Catch execution result handler failures, such as parsing issues (#374)
Browse files Browse the repository at this point in the history
## Summary
<!-- Succinctly describe your change, providing context, what you've
changed, and why. -->

Log an error to the console if handling an execution result fails. This
can happen if something simple like serialization fails when packaging
up the user's response.

## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by
wrapping it in "~~"" and suffix it with "N/A My reason for skipping
this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [ ] ~~Added a [docs PR](https://github.com/inngest/website) that
references this PR~~ N/A
- [ ] ~~Added unit/integration tests~~ N/A
- [x] Added changesets if applicable
  • Loading branch information
jpwilliams committed Oct 25, 2023
1 parent d45bfbd commit dcafc2b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-crabs-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": patch
---

Fixed an issue where an error log wasn't shown if execution result parsing failed, such as in the case of serialization failures
4 changes: 2 additions & 2 deletions packages/inngest/etc/inngest.api.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion packages/inngest/src/components/InngestCommHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,12 @@ export class InngestCommHandler<
stepOutput.type
] as ExecutionResultHandler<ActionResponse>;

return await handler(stepOutput);
try {
return await handler(stepOutput);
} catch (err) {
this.log("error", "Error handling execution result", err);
throw err;
}
}

if (method === "GET") {
Expand Down

0 comments on commit dcafc2b

Please sign in to comment.