Skip to content

Commit

Permalink
Allow disabling error logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
cskr committed Mar 23, 2011
1 parent 68ea558 commit 186226a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion grasshopper/lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var viewsDir = '.',
defaultCharset = 'UTF-8',
flashEnabled = true,
layout = undefined,
logErrors = true,
errorHandler = undefined;

exports.configure = function(config) {
Expand All @@ -47,6 +48,8 @@ exports.configure = function(config) {
defaultEncoding = config.defaultEncoding;
if(config.layout)
layout = config.layout;
if(config.logErrors !== undefined)
logErrors = config.logErrors;
if(config.errorHandler)
errorHandler = config.errorHandler;
if(config.flashEnabled !== undefined)
Expand Down Expand Up @@ -389,7 +392,7 @@ RequestContext.prototype._handleError = function(err) {
}

function defaultHandler() {
if(err) {
if(logErrors && err) {
util.debug(err.stack);
}
self.renderError(500, err);
Expand Down

0 comments on commit 186226a

Please sign in to comment.