Skip to content

Commit

Permalink
feat(utils/errors): uses source as message when it's a string
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed May 7, 2019
1 parent 30dac3a commit bbf86d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class KpoError<A> extends Error {
if (typeof source === 'object' && source !== null) {
message = (source as any).message;
}
if (!message && typeof source === 'string') message = source;
if (!message) message = 'An error occurred';
}

Expand Down

0 comments on commit bbf86d2

Please sign in to comment.