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

register_shutdown_function in HTTPBulkToolsResponse causes invalid JSON #204

Closed
kinglozzer opened this issue Aug 11, 2020 · 0 comments
Closed

Comments

@kinglozzer
Copy link
Contributor

kinglozzer commented Aug 11, 2020

In the event of a PHP warning being emitted, error_get_last() returns an error, which means that an extra message/status code is output after the JSON object in the response body - resulting in invalid JSON.

https://github.com/colymba/GridFieldBulkEditingTools/blob/master/src/BulkTools/HTTPBulkToolsResponse.php#L366-L378

I would suggest removing this behaviour entirely, or failing that at least check the type of error is fatal before outputting it

Oh, and exit() causes other registered shutdown functions to not fire, so my Sentry error handler never picked up the actual cause of the warning 😅

kinglozzer added a commit to kinglozzer/GridFieldBulkEditingTools that referenced this issue Aug 11, 2020
emteknetnz added a commit that referenced this issue Jun 2, 2021
FIX: Remove shutdown function for error output (fixes #204)
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

No branches or pull requests

1 participant