Skip to content
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

Open
luka5 opened this issue Jul 15, 2013 · 6 comments
Open

Support custom error message #13

luka5 opened this issue Jul 15, 2013 · 6 comments

Comments

@luka5
Copy link

luka5 commented Jul 15, 2013

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.

@rpedela
Copy link

rpedela commented Sep 10, 2013

+1

3 similar comments
@adrianheine
Copy link
Contributor

+1

@atrniv
Copy link

atrniv commented Jan 16, 2014

+1

@syadykin
Copy link

+1

@shachr
Copy link

shachr commented Jun 3, 2015

+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] );
});

@iliocatallo
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants