Beispiel #1
0
 /**
  * Batches up errors into notifications for later sending
  *
  * @param Bugsnag_Error $error    the error to batch up
  * @param array         $metaData optional meta data to send with the error
  */
 public function notify(Bugsnag_Error $error, $metaData = array())
 {
     // Queue or send the error
     if ($this->sendErrorsOnShutdown()) {
         // Create a batch notification unless we already have one
         if (is_null($this->notification)) {
             $this->notification = new Bugsnag_Notification($this->config);
         }
         // Add this error to the notification
         $this->notification->addError($error, $metaData);
     } else {
         // Create and deliver notification immediately
         $notif = new Bugsnag_Notification($this->config);
         $notif->addError($error, $metaData);
         $notif->deliver();
     }
 }
 public function testBeforeNotifySkipsError()
 {
     $this->notification->expects($this->never())->method("postJSON");
     $this->notification->addError($this->getError("SkipMe", "Message"));
     $this->notification->deliver();
 }