Skip to content

Commit

Permalink
ignore ECANCELED
Browse files Browse the repository at this point in the history
  • Loading branch information
rejetto committed Feb 1, 2022
1 parent 5f92976 commit b00ee70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ app.use(frontendAndSharedFiles)
app.on('error', errorHandler)

function errorHandler(err:Error & { code:string, path:string }) {
if (DEV && err.code === 'ENOENT' && err.path.endsWith('sockjs-node')) return // spam out
if (err.code === 'ECONNRESET' || err.code === 'ECONNABORTED') return // someone interrupted, don't care
const { code } = err
if (DEV && code === 'ENOENT' && err.path.endsWith('sockjs-node')) return // spam out dev stuff
if (code === 'ECANCELED' || code === 'ECONNRESET' || code === 'ECONNABORTED') return // someone interrupted, don't care
console.error('server error', err)
}

Expand Down

0 comments on commit b00ee70

Please sign in to comment.