You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rediscuss if error message changes are semver-major #3776
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.
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 major or reverted, but generally I'm in support of consistency.
Checking error strings is bad practice, and I don't see that we should necessarily support it.
As well as minor changes, typos, improved explanations, error strings may also be localised.
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: [code: 0123] <Variable error message>
Activity
Fishrock123 commentedon Nov 11, 2015
Fwiw I haven't landed 20285ad in v5.x for this (v5.1.0) release because I'm a little less sure about it.
cjihrig commentedon Nov 11, 2015
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.
silverwind commentedon Nov 12, 2015
It's likely to have code like this in the wild:
In this regard, one could see the message as part of the API. So it should be tagged as
majoror reverted, but generally I'm in support of consistency.silverwind commentedon Nov 12, 2015
I tagged #3374 and #3727 as
semver-major.silverwind commentedon Nov 12, 2015
cc @micnic
OrangeDog commentedon Nov 12, 2015
Checking error strings is bad practice, and I don't see that we should necessarily support it.
As well as minor changes, typos, improved explanations, error strings may also be localised.
If specific errors need specific handling, then error codes should be used instead.
micnic commentedon Nov 12, 2015
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:
[code: 0123] <Variable error message>OrangeDog commentedon Nov 12, 2015
Most errors already have a status code, an errno, an exit status, etc.
Fishrock123 commentedon Nov 12, 2015
TSCCTC punted it a week or so. Not going to be in the v5.1.0 release though.Fishrock123 commentedon Jan 11, 2016
Related: #4311
jasnell commentedon Mar 22, 2016
Believe this can be closed now.