Skip to content

Commit

Permalink
fix: supply default disconnected abort exception
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Jul 29, 2020
1 parent 5c0c509 commit 274ed53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/captp/lib/captp.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ export function makeCapTP(ourId, rawSend, bootstrapObj = undefined) {
};

// Abort a connection.
const abort = exception => dispatch({ type: 'CTP_ABORT', exception });
const abort = (
exception = Error(`disconnected from ${JSON.stringify(ourId)}`),
) => dispatch({ type: 'CTP_ABORT', exception });

return harden({ abort, dispatch, getBootstrap });
}

0 comments on commit 274ed53

Please sign in to comment.