but there is no feature to identify this error in code, I can only filter it by the exception name(UnhandledRejection), and the message is empty in the event object,
@haoflynet use the beforeSend callback in sentry. It’ll give an event object as the first arg in which contains an exception like the following:
{ "values":[ { "type":"UnhandledRejection", "value":"Non-Error promise rejection captured with keys: [object has no keys]", "mechanism":{ "synthetic":true, "handled":false, "type":"onunhandledrejection" } } ] }
You can use the value as a fallback when message is empty. Using the beforeSend callback will actually help to edit the exception before sending it to sentry or exclude it out before even sending it to sentry