Airbrake\Client::notifyOnException PHP Method

notifyOnException() public method

Notify on an exception
public notifyOnException ( Exception $e, null $extraParams = null ) : string
$e Exception
$extraParams null
return string
    public function notifyOnException(Exception $e, $extraParams = null)
    {
        $notice = new Notice();
        $notice->load(array('errorClass' => get_class($e), 'backtrace' => $this->cleanBacktrace($e->getTrace() ?: debug_backtrace()), 'errorMessage' => $e->getMessage() . ' in ' . $this->cleanFilePath($e->getFile()) . ' on line ' . $e->getLine(), 'extraParameters' => $extraParams));
        return $this->notify($notice);
    }

Usage Example

 function it_reports_exceptions()
 {
     // Arrange.
     $exception = new UnexpectedValueException();
     $extra = ['php' => 'wins'];
     // Act.
     $this->report($exception, $extra);
     // Assert.
     $this->airbrake->notifyOnException($exception, $extra)->shouldHaveBeenCalled();
 }
All Usage Examples Of Airbrake\Client::notifyOnException