سؤال

أنا أستخدم Node.js و "Less" الوسيطة المترجمة:

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>

لذلك هذا ليس مفيدًا. أي شخص لديه فكرة؟

هل كانت مفيدة؟

المحلول

آه ، حسنًا ، حصلت عليه. الحيلة هي أن تترك HORRERDLER

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