Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is really only going to affect people who use Rollbar - which is probably mostly just us.
The background for this issue is complicated, so I'll tl;dr it here and say - "This fix makes it so that error-suppressed things like
@$array['nonexistent_element']
will no longer send to Rollbar when in Production-mode".I tested that with and without the
@
in front of it. And without the@
, it still alerts Rollbar (and, also, fails to render the page, showing an error screen instead). With the '@' it prints a message to the Log. Full-fledged Exceptions continue to alert Rollbar normally.One concern I have - and I really have no idea how to 'fix' this concern - is that things like Parse errors are going to show weird error messages like "class \Log not found" which is going to look funny. Maybe I can find a way to detect parse errors in Pure PHP and do an early-return of- RESOLVED!true
so "normal" PHP error handling catches it all? Happy to discuss it, because it definitely will throw us for a loop at some point.Long Explanation
There's a lot of complicated stuff going on here. Regular 'exceptions' work just fine. Really. They do pretty much what you want them to. However, "old-school" PHP "errors" and such are not. Modern frameworks like Laravel will typically patch in a
set_error_handler()
callback that will turn those errors and warnings into Exceptions, which will filter their way up the stack. Furthermore, Rollbar itself does the same thing - in order to report them to Rollbar. So I can't really tell which error handler is messing up which, here - but it's very confusing.The best solution I could come up with is to figure out how to use Rollbar's
check_ignore
config option, and find things that were originallyE_WARNING
and filter those out - only when in Production, though.