Skip to content

Commit

Permalink
bug950836 - don't throw if bad config
Browse files Browse the repository at this point in the history
  • Loading branch information
alicoding committed Dec 17, 2013
1 parent dbd8af6 commit ccdf7e8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions i18n.js
Expand Up @@ -305,7 +305,7 @@ exports.middleware = function(options) {
locale, messages_file_path(locale), e
);
console.error(msg);
throw msg;
return;
}
});
return localeStrings;
Expand All @@ -321,8 +321,16 @@ exports.middleware = function(options) {
'Bad locale=[%s] missing .json files in [%s]. See locale/README (%s)',
locale, messages_file_path(locale), e
);
// Only console error if bad config then we remove them off from the list so
// that we can continue with no problem.
console.error(msg);
throw msg;
listSupportedLang = _.remove(listSupportedLang, function(l) {
return l !== locale;
});
options.supported_languages = _.remove(options.supported_languages, function(l) {
return l !== locale;
});
return;
}
});

Expand Down

0 comments on commit ccdf7e8

Please sign in to comment.