Skip to content

await next in hono error handler middleware#2735

Open
gingerbenw wants to merge 25 commits intonextfrom
gingerbenw/hono-async-await
Open

await next in hono error handler middleware#2735
gingerbenw wants to merge 25 commits intonextfrom
gingerbenw/hono-async-await

Conversation

@gingerbenw
Copy link
Copy Markdown
Member

@gingerbenw gingerbenw commented Apr 22, 2026

Goal

Updates the Hono plugin’s error-handling middleware to properly await next() and adds/adjusts integration tests and fixtures to cover async behavior, non-Error throws, and request-body parsing.

Changeset

  • Update @bugsnag/plugin-hono error handler to await next() and handle thrown non-Error values.

Testing

  • Extend Node maze-runner steps/features to allow POSTing with an explicit Content-Type (including JSON).
  • Adjust AWS Lambda Hono feature coverage and upload maze output artifacts on workflow failure.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 51.76 kB 15.30 kB
After 51.76 kB 15.30 kB
± No change No change

code coverage diff

Ok File Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js/bugsnag-js/packages/plugin-hono/src/hono.js 90%
(-4.11%)
75%
(-15%)
100%
(+0%)
85.71%
(-8.57%)

Total:

Lines Branches Functions Statements
84.93%(-0.02%) 77.1%(-0.06%) 85.17%(+0%) 84.17%(-0.06%)

Generated by 🚫 dangerJS against e69ccea

@gingerbenw gingerbenw force-pushed the gingerbenw/hono-async-await branch from b606807 to 521b9db Compare April 23, 2026 08:45
@gingerbenw gingerbenw force-pushed the gingerbenw/hono-async-await branch from a175c8d to 2c37bcd Compare April 24, 2026 14:38

This comment was marked as resolved.

And the event "session.events.unhandled" equals 1

@hono-app
Scenario Outline: unhandled exceptions are reported when using hono
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have no Examples to step through, so should use Scenario rather than Scenario Outline

And the event "session.events.unhandled" equals 1

@hono-app
Scenario: thrown non-error exceptions are reported when using hono
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to unhandled.feature as this should have nothing to do with promise rejections


app.get('/handled', async (c, next) => {
Bugsnag.notify(new Error('handled'));
c.bugsnag.notify(new Error('handled'));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the request scoped version of bugsnag

Comment on lines +42 to +48
- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: aws-lambda-test-results
path: test/aws-lambda/maze_output/
if-no-files-found: ignore
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only upload artifacts when the tests fail so we can view the actual payloads

@gingerbenw gingerbenw marked this pull request as ready for review April 24, 2026 15:45
@gingerbenw gingerbenw requested review from a team and hannah-smartbear April 24, 2026 15:46
@gingerbenw gingerbenw changed the title Gingerbenw/hono async await await next in hono error handler middleware Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants