-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Rediscuss if error message changes are semver-major #3776
Comments
Fwiw I haven't landed 20285ad in v5.x for this (v5.1.0) release because I'm a little less sure about it. |
I think #3374 was a broad enough change to constitute a semver-major. We don't generally change error messages just for the sake of changing them. I also think that if an error message changes as the side effect of a bug fix, that shouldn't constitute a semver-major. |
It's likely to have code like this in the wild: if (err && /something/.test(err.message))
// do something specific to that error In this regard, one could see the message as part of the API. So it should be tagged as |
cc @micnic |
Checking error strings is bad practice, and I don't see that we should necessarily support it. If specific errors need specific handling, then error codes should be used instead. |
I also agree that checking error messages is a bad practice, and I guess that in the wild it is somewhere used, so I think we should put it as a major change to minimize the frustration of those who check them when using a new version of node. Maybe in the future we could add some prefixed error messages with a fixed code like this: |
Most errors already have a status code, an errno, an exit status, etc. |
|
Related: #4311 |
Believe this can be closed now. |
See #3374
Opening here to tag for the ctc agenda.
The text was updated successfully, but these errors were encountered: