Skip to content

Conversation

@markthree
Copy link
Contributor

πŸ”— Linked issue

h3js/h3#695

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

We should use the user-defined onError hook

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

_loadedEntry;

if (_handler.options && _handler.options.onError) {
app.options.onError = _handler.options.onError;
Copy link
Member

Choose a reason for hiding this comment

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

I was thinking we could inherit/merge all options. For example for this h3js/h3#693 (and debug option)

Copy link
Contributor Author

@markthree markthree Mar 7, 2024

Choose a reason for hiding this comment

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

Of course this would be better, but I've tested how to do the merge and some of the hooks trigger twice

for example ↓

if (_handler.options) {
  // This causes some hooks to run twice
  app.options = Object.assign(app.options, _handler.options)
}

I think this might be a bug in h3, and I think I'd have to look deeper at h3 as well.

I like unjs/h3#693,But I'd like to see the logic of your implementation, let's try to keep the behavior consistent πŸ₯°

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