-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interface changes #104
Comments
I think it was mentioned in one of the issues that it would be right? FWIW I think there is nothing wrong with packages like this working ahead and doing major releases as long as we are clear on the minimum support from the LTS strat as mentioned in expressjs/discussions#210 |
Yes, Im saying that any of these changes would indeed be semver major. Im in no rush to make this change or the subclassing change. This is a tracking issue for a change which is...
if we did want to land a change in this category, it would need to be in a major. From reading issue history since posting this though, this seems to be incorrect:
@dougwilson mentioned in a comment that he was planning to make all properties nonenumerable in v3, but that's the only v3 ref Ive run into so far. There aren't any plans for a new major at least in that it's not documented in the repo or issues so far as I can tell. |
Based on #103
Users likely expect to be able to pass custom properties to errors when creating them via the shortcut methods such as
createError.NotFound()
.Proposed change would look something like:
You need to use the
createError({...})
form to pass custom properties to an error.There's a few caveats with the current implementation, namely you can't set
status
via properties.There is also a very high arity for
createError
, which should be locked down into a stable interface.(code)
Any of these changes would be semver major. There aren't plans for a major release of
http-errors
yet, but these are things Im thinking about.why did I put these both in one issue?
These are both topics related to the interfaces exposed by the library for accepting arguments, which can use some rethinking.
The text was updated successfully, but these errors were encountered: