Example #1
0
 public function shutdownHandler()
 {
     // Get last error
     $lastError = error_get_last();
     // Check if a fatal error caused this shutdown
     if (!is_null($lastError) && Bugsnag_ErrorTypes::isFatal($lastError['type']) && $this->config->autoNotify && !$this->config->shouldIgnoreErrorCode($lastError['type'])) {
         $error = Bugsnag_Error::fromPHPError($this->config, $this->diagnostics, $lastError['type'], $lastError['message'], $lastError['file'], $lastError['line'], true);
         $error->setSeverity("error");
         $this->notify($error);
     }
     // Flush any buffered errors
     if ($this->notification) {
         $this->notification->deliver();
         $this->notification = null;
     }
 }