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
Standardize on error codes for errors express throws #6951
It would be great to move to using (and documenting) explicit error codes for errors that express itself generates, to allow folks to use them as a contract if they wish. That would free us up from having to worry that someone is matching on error messages themselves, and therefore making error messages part of the semver contract with users.
to jog memories, this came up recently when discussing #6756
We don't have all that many tbh, but here's a table I had claude make w/ sites where we generate an error:
Activity
efekrskl commentedon Dec 17, 2025
We should definitely do this. I was recently going through the codebase, and our errors messages are really inconsistent 😅
Should we also brand our errors like Fastify does? (e.g FST_xxx)
sanwalsulehri commentedon Dec 18, 2025
byteforge38 commentedon Jan 9, 2026
Hi @jonchurch , can you assign this issue to me?
feat: add error codes for Express-thrown errors (expressjs#6951)
jonchurch commentedon Jan 10, 2026
This is in the discussion phase currently so Im not planning on assigning it to anyone outside the core team currently 🙇
Delapouite commentedon Feb 9, 2026
Related: a new TC39 proposal has recently been created to officialize the
error.codeproperty:https://github.com/jasnell/proposal-error-code-property
feat: brand error codes with EXPRESS_ERR_ prefix and document them
feat: add express.isExpressError() helper