reactphp / promise

Promises/A implementation for PHP.
https://reactphp.org/promise/
MIT License
2.38k stars 146 forks source link

Add new `set_rejection_handler()` function for unhandled rejections #249

Closed clue closed 1 year ago

clue commented 1 year ago

This changeset adds a new set_rejection_handler() function to set the global rejection handler for unhandled promise rejections.

The default promise rejection handler will log an error message plus its stack trace. The new set_rejection_handler() function may be used to use customize the log message or write to custom log targets.

Builds on top of #248 Refs #87