Skip to content

Commit

Permalink
Allow Promise to display error strings and not just error objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelambert committed Sep 19, 2016
1 parent 04392f2 commit 05ade5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Libraries/Promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ if (__DEV__) {
allRejections: true,
onUnhandled: (id, error = {}) => {
const {message = null, stack = null} = error;
if (typeof error === 'string' || error instanceof String) {
message = error;
}
const warning =
`Possible Unhandled Promise Rejection (id: ${id}):\n` +
(message == null ? '' : `${message}\n`) +
Expand Down

0 comments on commit 05ade5a

Please sign in to comment.