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
I have searched existing issues to ensure the issue has not already been raised
Issue
Maybe it makes sense to have a strict amount of parameters. So when the format string is '"%s is not a valid %s", then we need to provide exact two parameters. If you provide zero, one or more than two parameters, we have an issue. Like nodejs errors are done. This would result in the ability to say, that the last parameter is e.g. used for "cause" or other options.
Now the implementation of #116 is kind of messy. But not because of the contributor but because our code is not good enough.
This would be a semver-major.
Also we could then use #103 and avoid the use of util format, making it platform independent. Maybe also usable in browser.
The text was updated successfully, but these errors were encountered:
If a major is required, I still suggest going one further:
constcreateError=fastifyError({code: 'ERROR_CODE',message: '%s did bad stuff, because %s'})constinstance=createError({messageParams: ['Foo','bad syntax'],cause: Error('boom')})
Prerequisites
Issue
Maybe it makes sense to have a strict amount of parameters. So when the format string is '"%s is not a valid %s", then we need to provide exact two parameters. If you provide zero, one or more than two parameters, we have an issue. Like nodejs errors are done. This would result in the ability to say, that the last parameter is e.g. used for "cause" or other options.
Now the implementation of #116 is kind of messy. But not because of the contributor but because our code is not good enough.
This would be a semver-major.
Also we could then use #103 and avoid the use of util format, making it platform independent. Maybe also usable in browser.
The text was updated successfully, but these errors were encountered: