From 05ade5a0a89c7c3339b017150128fe4d2991de2a Mon Sep 17 00:00:00 2001 From: Mike Lambert Date: Mon, 19 Sep 2016 19:16:02 -0400 Subject: [PATCH] Allow Promise to display error strings and not just error objects. --- Libraries/Promise.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/Promise.js b/Libraries/Promise.js index 7b52e135cc33f9..6fea6d0c38cd2e 100644 --- a/Libraries/Promise.js +++ b/Libraries/Promise.js @@ -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`) +