Home

Awesome

think-trace

npm Travis Coveralls David

think-trace is an error handler for ThinkJS 3.x and koa2. It provides a pretty error web interface that helps you debug your web project.

Installation

npm install think-trace

How To Use

Koa2

const traceMiddleware = require('think-trace');
app.use(traceMiddleware({
  sourceMap: false,
  error: err => console.error(err)
}));

ThinkJS3.x

Modify src/config/middleware.js:

const trace = require('think-trace');

module.exports = [
  {
    handle: trace, 
    options: {
      sourceMap: false,
      error(err, ctx) {
        return console.error(err);
      }
    }
  }
];

Options

Contributing

Contributions welcome!

License

MIT