diff --git a/app.js b/app.js index dbd958a..f87bd43 100644 --- a/app.js +++ b/app.js @@ -42,6 +42,16 @@ http.createServer(app).listen(config.port, "::",() => { `) }) +// error handler +app.use(function(err, req, res, next) { + console.log(` +程序出现错误 +status信息为:${err.status} +message信息为:${err.message} +error为:${err} +`) +}); + // app.listen(config.port, () => { // console.log(`