public function shutdownHandler() { // Get last error $lastError = error_get_last(); // Check if a fatal error caused this shutdown if (!is_null($lastError) && Wapplogs_ErrorTypes::isFatal($lastError['type'])) { $error = Wapplogs_Error::fromPHPError($this->config, $this->diagnostics, $lastError['type'], $lastError['message'], $lastError['file'], $lastError['line'], true); $error->setSeverity("error"); if (!$error->shouldIgnore() && $this->config->autoNotify) { $this->notify($error); } } // Flush any buffered errors if ($this->notification) { $this->notification->deliver(); $this->notification = null; } }
public function setPrevious($exception) { if ($exception) { $this->previous = Wapplogs_Error::fromPHPException($this->config, $this->diagnostics, $exception); } return $this; }