diff --git a/lib/controller/error_controller.js b/lib/controller/error_controller.js
index <HASH>..<HASH> 100644
--- a/lib/controller/error_controller.js
+++ b/lib/controller/error_controller.js
@@ -32,6 +32,9 @@ utils.mixin(ErrorController.prototype, new (function () {
     if (err.statusCode == 404) {
       err.message = 'Could not find page "' + this.request.url + '"'
     }
+    if (parseInt(err.statusCode, 10) > 499) {
+      this.response.resp._stack = err.stack || err.message;
+    }
     this._respond(err, opts);
   };
Get stack-traces back in request logs, custom-error code