/** * Determine the type of the output * * @param string $buffer * * @return Boolean */ public function catchErrors($buffer) { if (!is_null(error_get_last())) { $this->logger->error($buffer); // Send error as email as configured if ($this->config('email_errors')) { $this->mailer->send('Crunz: reporting PHP Fatal error', $buffer); } } return $buffer; }
/** * Handle errors * * @param \Crunz\Event $event */ protected function handleError(Event $event) { if ($this->config('log_errors')) { $this->logger->error($this->formatEventError($event)); } else { $this->display($event->getProcess()->getErrorOutput()); } // Send error as email as configured if ($this->config('email_errors')) { $this->mailer->send('Crunz: reporting error for event:' . ($event->description ? $event->description : $event->getId()), $this->formatEventError($event)); } }