rollbar-php icon indicating copy to clipboard operation
rollbar-php copied to clipboard

Rollbar:log() does not deliver content of \PDOException exceptions

Open djibarian opened this issue 4 years ago • 3 comments

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).

djibarian avatar May 29 '20 14:05 djibarian

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?

djibarian avatar May 29 '20 15:05 djibarian

Interesting! Definitely should, as forwarding an Exception is straight out of the documentation.

What version of PHP were you using?

bishopb avatar Dec 03 '20 04:12 bishopb

PHP 7.2

djibarian avatar Dec 03 '20 07:12 djibarian