mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Fixed most errors in middleware
This commit is contained in:
parent
43c0cdfd1e
commit
7db8b54476
9 changed files with 138 additions and 173 deletions
|
@ -8,11 +8,12 @@ const stats = require('../../stats')
|
|||
exports.expressCreateServer = (hook_name:string, args: ArgsExpressType, cb:Function) => {
|
||||
// Handle errors
|
||||
args.app.set_error_handler((req, res, error)=>{
|
||||
console.log('Error: ', error);
|
||||
// if an error occurs Connect will pass it down
|
||||
// through these "error-handling" middleware
|
||||
// allowing you to respond however you like
|
||||
res.status(500).json({error: 'Sorry, something bad happened!'});
|
||||
console.error(error.stack ? error.stack : error.toString());
|
||||
//res.status(500).json({error: 'Sorry, something bad happened!'});
|
||||
stats.meter('http500').mark();
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue