Example #1
0
 protected function _processError(\Exception $ex, ErrorModel $model)
 {
     $model->description = str_replace('%code%', $ex->getCode(), $model->description);
     $model->description = str_replace('%message%', $ex->getMessage(), $model->description);
     if ($ex instanceof EricssonException) {
         $model->description = str_replace('%reason%', $ex->getReason(), $model->description);
     }
     return $model;
 }
 /**
  * @param \Exception $exception
  *
  * @return CriticalConfigurationError
  */
 public static function fromException(\Exception $exception)
 {
     $reason = null;
     $file = null;
     if ($exception instanceof ConfigurationError) {
         $reason = $exception->getReason();
         $file = $exception->getConfFile();
     } else {
         $reason = $exception->getMessage();
     }
     return new CriticalConfigurationError($reason, $file);
 }