Example #1
0
 /**
  * Log exception
  *
  * @param \Exception $exception
  * @return \Consumerr\Entities\Error
  */
 public static function addError(\Exception $exception)
 {
     if ($exception instanceof \ErrorException && self::$configuration->isErrorDisabled($exception->getSeverity())) {
         self::log("Error handler - severity {$exception->getSeverity()} is ignored by current disabled-severity setting.");
         return NULL;
     }
     $error = new Entities\Error($exception);
     self::getAccess()->addError($error);
     self::log("Added error - '" . get_class($exception) . " - " . $exception->getMessage() . "'");
     return $error;
 }