我使用的node.js和 “少” 的编译器中间件:

app.configure(function() {
    // ...
    app.use(express.compiler({ src: __dirname + '/public', enable: ['less'] }))
    // ...
})

现在我有一个错误的.less文件,但我不能找到如何得到错误消息的任何文档。 我接收所述寻呼是这样的:

<html>
  <head>
    <title>[object Object]</title>
    <style>
      /* css stuff */
    </style>
  </head>
  <body>
    <div id="wrapper">
      <h1>Connect</h1>

      <h2><em>500</em> [object Object]</h2>
      <ul id="stacktrace"></ul>
    </div>
  </body>
</html>

所以这是没有帮助的。任何人有一个想法?

有帮助吗?

解决方案

嗯,好的,知道了。关键是要离开远发展的ErrorHandler

app.configure('development', function() {
    // app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});

看来吞app.error通话,所以现在这个作品:

app.error(function(err, req, res, next) {
    sys.puts("APP.ERROR:" + sys.inspect(err));
    next(err);
});

这示出了正确的错误代替[对象的对象]

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top