Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception cant be caught in concurrently #418

Closed
foremtehan opened this issue Nov 10, 2021 · 1 comment · Fixed by #419
Closed

Exception cant be caught in concurrently #418

foremtehan opened this issue Nov 10, 2021 · 1 comment · Fixed by #419
Assignees
Labels

Comments

@foremtehan
Copy link
Contributor

  • Octane Version: 1.0.18
  • PHP Version: 8.*
  • Server & Version: Swoole

Description:

When some exception thrown in Octane::concurrently it terminate the script even though on try/catch

Steps To Reproduce:

try {
    Octane::concurrently([fn() => throw new \Exception('exception occur')]); // log has this exception
} catch (\Throwable) {
    // 
}
@Namoshek
Copy link
Contributor

Haven't played with this feature myself yet, but I guess you should add the exception handling to each of the closures you are passing to Octane::concurrently() to ensure each closure returns a valid result (or potentially some sort of optional result which can be success/error at the same time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants