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

Browser: Display PHP output when Fatal Error is trigerred #1234

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Apr 12, 2024

What does this PR do?

This PR restores displaying the PHP output when a PHP error is encountered. It does that by attaching response to the error thrown by BasePHP and augmenting the Comlink transfer handler to pass that response between workers through postMessage.

What problem does it solve?

Prior to be0e783, script output was still shown for Fatal Errors. For example, when reproducing the memory-related errors under #1128, we used to see something like the following where page output was shown along with the Fatal Error that ended execution.

But now that we are no longer returning a PHPResponse when there is a non-zero exit code, the content is not updated when running the same script. The error message is printed to the console, but the partial content is not visible to the user. Instead the previous content is left in place as if the script had not run at all.

Closes #1231

Testing instructions

Ensure the E2E tests pass

 ## What does this PR do?

This PRrestores displaying the PHP output when a PHP error is
encountered. It does that by attaching `response` to the error thrown by
BasePHP and augmenting the Comlink transfer handler to pass that
response between workers through postMessage.

 ## What problem does it solve?

Prior to be0e783, script output was still shown for Fatal Errors. For example, when reproducing the memory-related errors under #1128, we used to see something like the following where page output was shown along with the Fatal Error that ended execution.

But now that we are no longer returning a PHPResponse when there is a non-zero exit code, the content is not updated when running the same script. The error message is printed to the console, but the partial content is not visible to the user. Instead the previous content is left in place as if the script had not run at all.

Closes #1231

 ## Testing instructions

Ensure the E2E tests pass
@adamziel adamziel merged commit 9973adb into trunk Apr 12, 2024
5 checks passed
@adamziel adamziel deleted the display-error-information branch April 12, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatals in main web script result in a blank content area
1 participant