rollbar-php
rollbar-php copied to clipboard
Rollbar:log() does not deliver content of \PDOException exceptions
In the following code
try{
blah();
}
catch(Exception $e){
Rollbar::log(Level::ERROR, “this is sent”);
Rollbar::log(Level::ERROR, $e); /* this is not */
}
the first log is sent to Rollbar, but not the second. I can’t figure out what is wrong there. Removing the catch
or throwing inside it does the same, the exception is not sent (intentionally raised by causing a syntax error).
I have more data: $e is of type PDOException
. That seems to be the cause as if I convert it to throw new Exception($e->getMessage())
the error shows up in Rollbar. But why Rollbar is not sending it originally?
Interesting! Definitely should, as forwarding an Exception is straight out of the documentation.
What version of PHP were you using?
PHP 7.2