Skip to content

Commit

Permalink
feat(console): emit error event on connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed Jul 30, 2021
1 parent 1c2fe87 commit 995aaad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/console/consoleConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export class ConsoleConnection extends EventEmitter implements Connection {

connection.on("error", (error) => {
console.error(`Connection on port ${port} encountered an error.`, error);
this.emit(ConnectionEvent.ERROR);

This comment has been minimized.

Copy link
@vinceau

vinceau Jul 30, 2021

Member

Shouldn't you emit the actual error message with the emit call? Also should we change the previous line to console.warn since it's not something the user can catch?

});

this.connection = connection;
Expand Down

0 comments on commit 995aaad

Please sign in to comment.