Fixes#8172
Fixes COMPILER-EXPLORER-DXM
Safari sometimes rejects promises with CustomEvent/Event objects instead
of Error objects. When JSON.stringify() is called on these Event objects,
it returns '{}' because Event properties are non-enumerable.
This fix extracts useful diagnostic properties (type, target, detail)
from Event/CustomEvent objects before creating the error message,
providing actionable information instead of empty objects.
Changes:
- Add isEventLike() type guard to detect Event/CustomEvent objects
- Add formatEventRejection() to extract meaningful Event properties
- Refactor unhandledrejection handler with cleaner ternary chain
- Use Object.assign() for type-safe property addition
- Add references to GitHub issue and related Sentry SDK issue
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>