proxy connection errors no longer crash the server, fixes #37

This commit is contained in:
Lloyd Brookes
2016-05-30 00:32:51 +01:00
parent 0eb5998605
commit aa11620b8e
5 changed files with 37 additions and 64 deletions

View File

@ -42,15 +42,10 @@ if (options.misc.help) {
const _use = app.use
app.use = x => _use.call(app, convert(x))
// app.use((ctx, next) => {
// return next()
// .catch(err => {
// console.error('FUKKK', err)
// })
// })
app.on('error', err => {
console.error('ERROROO', err)
if (options.server['log-format']) {
console.error(ansi.format(err.message, 'red'))
}
})
const ws = localWebServer({