-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support custom error message #13
Comments
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 It would be best to map all errors into codes and support a custom translation function: js.translateErrorCode( function( code, defaultErrorMessage, callback ){
var locale = process.domain.getLocale();
var errorMessages = require("./errorMessages/"+ locale);
callback( null, errorMessages[code] );
}); |
+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently all the useful error messages are hardcoded.
To support custom error message, e.g. localized, it would be great having an optional parameter defining the messages.
The text was updated successfully, but these errors were encountered: