reactphp / promise

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

Trigger E_USER_ERROR on unhandled exceptions #170

Closed WyriHaximus closed 1 year ago

WyriHaximus commented 4 years ago

Largely based on @clue's work at https://github.com/clue-labs/promise/commit/0feb517431633f6fc3da462cbea5c6bbba3d47d8 to trigger an error when a rejected promise hasn't been handled.

Closes #87

WyriHaximus commented 4 years ago

@clue updated this PR to match your latest experiment /cc @jsor

WyriHaximus commented 3 years ago

As discussed with @clue, adding a test case to spawn a child process, force it to have an unhandled rejected promise and expect a 255 exit code.

WyriHaximus commented 3 years ago

@clue @jsor test added

WyriHaximus commented 3 years ago

Had a long chat with @clue about this today. And we came to the conclusion that killing off the process in 3.0 is to soon. It would mean a hard migration, and while we will have our own projects ready by then, the ecosystem might be caught off guard by it.

What we want to do instead, is still be in your face annoying about this but not kill the process. We're still figuring out the best way for that as we can't use the exception handler for this, and we want to provide users with the full context plus a way to catch any of these unhandled errors. This possibly comes down to providing a singleton accepting a handler.