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
Jesus, I've spent so much time to find how to do it.
http-errors has possibility to add additional fields to error like this:
createError(503,'No work on the sabbath.',{type: 'DayError',expose: true})
However, formatError function cuts all additional properties and produces only message field. To add this additional error fields you have to use extensions property like this:
createError(503,'No work on the sabbath.',{extensions: {type: 'DayError'},expose: true})
This will correctly show additional error information to user:
Please, add this to docs somewhere. I really hope it will help and save time for someone else.
❤️
The text was updated successfully, but these errors were encountered:
Jesus, I've spent so much time to find how to do it.
http-errors
has possibility to add additional fields to error like this:However, formatError function cuts all additional properties and produces only
message
field. To add this additional error fields you have to useextensions
property like this:This will correctly show additional error information to user:
Please, add this to docs somewhere. I really hope it will help and save time for someone else.
❤️
The text was updated successfully, but these errors were encountered: