Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
fix: catch uncaught exceptions from pull in dialer.handle
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun committed Aug 15, 2018
1 parent a59306c commit d3cd2e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
"lodash.range": "^3.2.0",
"once": "^1.4.0",
"pull-handshake": "^1.1.4",
"pull-length-prefixed": "^1.3.0",
"pull-length-prefixed": "^1.3.1",
"pull-stream": "^3.6.7",
"semver": "^5.5.0",
"varint": "^5.0.0"
},
"devDependencies": {
"aegir": "^13.1.0",
"aegir": "^15.1.0",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"libp2p-multiplex": "~0.5.1",
Expand Down
16 changes: 11 additions & 5 deletions src/dialer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ class Dialer {
callback()
}, this.log)

pull(
rawConn,
s,
rawConn
)
// Handle unexpected errors from pull, like 'already piped'
try {
pull(
rawConn,
s,
rawConn
)
} catch (err) {
this.log.error(err)
callback(err)
}
}

/**
Expand Down

0 comments on commit d3cd2e5

Please sign in to comment.