You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@caucik Thanks for reporting, I understand where you're coming from. Throwing an exception from any listener is not allowed:
The listener callback function MUST NOT throw an Exception. The return value of the listener callback function will be ignored and has no effect, so for performance reasons you're recommended to not return any excessive data structures.
As an alternative, I would recommend either letting the uncaught exception crash your application like it appears to do right now or if you want to handle it, wrapping your event handler code in a try-catch-block like this:
$loop->addPeriodicTimer(3.0, function () {
try {
apiThatMightThrow();
} catch (Exception$e) {
// exception is non-fatal here, we simply log and wait for next iterationlogException($e);
}
});
After the exception in thrown the socket connection can no longer be properly closed nor resumed. See Close behavior.
The text was updated successfully, but these errors were encountered: