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

Fatals in main web script result in a blank content area #1231

Closed
brandonpayton opened this issue Apr 12, 2024 · 1 comment · Fixed by #1234
Closed

Fatals in main web script result in a blank content area #1231

brandonpayton opened this issue Apr 12, 2024 · 1 comment · Fixed by #1234

Comments

@brandonpayton
Copy link
Member

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.

Screenshot 2024-04-11 at 10 34 25 PM

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.

Screenshot 2024-04-11 at 10 39 35 PM

When running PHP normally, wouldn't the partial content be shown? It seems like Playground should show whatever output PHP would typically show.

Would it be possible for us to restore returning PHPResponse even when there is an error and use messaging or events to relay info for error logging?

cc @bgrgicak @adamziel

adamziel added a commit that referenced this issue Apr 12, 2024
 ## 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 added a commit that referenced this issue 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
@brandonpayton
Copy link
Member Author

This is great. Thank you, @adamziel !

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

Successfully merging a pull request may close this issue.

1 participant