-
Notifications
You must be signed in to change notification settings - Fork 30
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
Uncaught exceptions on hex char been deliverd to verror.js #92
Comments
Hi @kobymolcho, do you have a sample code snippet here to reproduce the exact exception you are seeing? Anything involving the |
try this out: |
Thanks! What version of restify-errors are you using? If you reduce it down to just these two lines, can you confirm the exception you are seeing: const errs = require('restify-errors');
var err = new errs.NotFoundError('1234%25d1234'); /Users/aliu/Sandbox/test/node_modules/extsprintf/lib/extsprintf.js:97
throw (jsError(ofmt, convposn, curconv,
^
Error: format string "1234%25d1234": conversion specifier "%25d" at character 5 has no matching argument (too few arguments passed) |
i'm using 6.4.0, and yes - i can confirm this two lines throws.. |
Thanks for the confirmation. This is expected behavior - you can work around it for now: var err = new errs.NotFoundError('%s', '1234%25d1234'); Alternatively, some work is happening over in TritonDataCenter/node-verror#57 to allow disabling of printf via a constructor option. |
That's a great tip.. Thank you! |
As it looks like this was resolved (and behavior was expected), I'll close this ticket now. @kobymolcho let us know if that isn't the case. |
when creating new restify error with a "%25" as a prefix and than one of the following chars (e,E,f,g,G,d etc...) the application will break with an uncaught exception.
it looks like verror uses sprintf, and it encodes "%25" a real "%" delivered as an argument.
this end with "Error: next shouldn't be called more than once"
The text was updated successfully, but these errors were encountered: