From fe055b0811953bde93bea05d333afafe35e55461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Tue, 27 Feb 2018 11:10:54 +0100 Subject: [PATCH] ref: Log promise rejection reason alongside eventid --- lib/client.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index 65616fc..79a0967 100644 --- a/lib/client.js +++ b/lib/client.js @@ -123,7 +123,17 @@ extend(Raven.prototype, { global.process.on('unhandledRejection', function(reason, promise) { var context = promise.domain && promise.domain.sentryContext; self.captureException(reason, context || {}, function(sendErr, eventId) { - if (!sendErr) utils.consoleAlert('unhandledRejection captured: ' + eventId); + if (!sendErr) { + var reasonMessage = (reason && reason.message) || reason; + utils.consoleAlert( + 'unhandledRejection captured\n' + + 'Event ID: ' + + eventId + + '\n' + + 'Reason: ' + + reasonMessage + ); + } }); }); }