Permalink
Browse files

Add log error on http/rt. Remove env.response.err

  • Loading branch information...
1 parent f374457 commit 1713f76ba55eeb0dd8eb1647942214ac1c116a9c @ixti ixti committed Apr 18, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/init/http_server.js
@@ -98,6 +98,8 @@ function attach_connect_app(server) {
res.end(err.message || 'Forbidden');
return;
} else if (err) {
+ nodeca.logger.error(err.stack || err.toString());
+
res.statusCode = 500;
res.end(('development' !== nodeca.runtime.env) ? 'Application error'
: (err.stack || err.toString()));
@@ -182,17 +184,17 @@ function attach_socket_io(server) {
lang: nodeca.config.locales.default
},
response: {
- err: {
- code: null,
- message: null
- },
data: {},
layout: 'default',
view: msg.method
}
};
nodeca.filters.run(msg.method, msg.params, fn, function (err) {
+ if (err) {
+ nodeca.logger.error(err.stack || err.toString());
+ }
+
(cb || noop)({
version: nodeca.runtime.version,
error: (err ? err.toString() : null),

0 comments on commit 1713f76

Please sign in to comment.