This commit is contained in:
10
app.js
10
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(`
|
||||
|
||||
Reference in New Issue
Block a user