Skip to content

Commit

Permalink
fix: error event propagation (#233)
Browse files Browse the repository at this point in the history
* fix: error event propagation

* fix: register error event first
  • Loading branch information
hugomrdias authored and daviddias committed May 4, 2018
1 parent b781fbb commit db3dd68
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ yarn.lock
**/*.log
test/repo-tests*

.vscode
.eslintrc
# Logs
logs
*.log
Expand Down
1 change: 1 addition & 0 deletions src/factory-in-proc.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class FactoryInProc {
}

const node = new Node(options)
node.once('error', err => callback(err, node))

series([
(cb) => node.once('ready', cb),
Expand Down
1 change: 1 addition & 0 deletions src/ipfsd-in-proc.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Node extends EventEmitter {
libp2p: this.opts.libp2p
})

this.exec.once('error', err => this.emit('error', err))
this.exec.once('ready', () => this.emit('ready'))
}

Expand Down

0 comments on commit db3dd68

Please sign in to comment.