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

[ReactPHP] Handle uncaught errors by sending their error message as response back #9538

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WyriHaximus
Copy link

No description provided.

@@ -38,7 +39,9 @@ function requestHandler(): Closure
'/update' => updateraw(queryCount($request), $world, $update),
// '/info' => info(),
default => new Response(404, [], 'Error 404'),
};
}))->catch(
static fn (Throwable $error): PromiseInterface => resolve(Response::plaintext($error->getMessage())->withStatus(200)), // This should be a 500, but with a 200 the benchmarking tooling considers the framework alive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to send a 500 response to the tests.
The problem is in React or the code. The app is blocked again when send a 500.
I said it to fix the root of the problem.

You can check it with the plain PHP files, and send a 500 error, the tests will continue normally and the tests fail.

Copy link
Contributor

@joanhey joanhey Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update your local repo, because my PR is included now, and the db tests are disabled.
So never will arrive to this catch().

So this PR need to include again the tests.

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

Successfully merging this pull request may close these issues.

2 participants