express 捕获后台出现的异常
const express = require('express')
const app = express()
app.use((err, request, response) => {
const {status} = err
if (status === 401) {
response.status(401)
response.send(Message.sendFail('无token'))
}
// ...
})
标签:status,const,捕获,express,后台,response
From: https://www.cnblogs.com/zhumenglong/p/16949751.html