src/wcmf/lib/presentation/ApplicationError.php
public static function fromException(\Exception $ex) {
    if ($ex instanceof ApplicationException) {
      return $ex->getError();
    }
    if ($ex instanceof AuthorizationException) {
      return self::get(PERMISSION_DENIED);
    }
    return self::getGeneral($ex->getMessage());
  }
public static function fromException(\Exception $ex) {
    if ($ex instanceof ApplicationException) {
      return $ex->getError();
    }
    if ($ex instanceof AuthorizationException) {
      return self::get(PERMISSION_DENIED);
    }
    return self::getGeneral($ex->getMessage());
  }
public static function fromException ( \ Exception $ ex ) { if ( $ ex instanceof ApplicationException ) { return $ ex -> getError ( ) ; } if ( $ ex instanceof AuthorizationException ) { return self :: get ( PERMISSION_DENIED ) ; } return self :: getGeneral ( $ ex -> getMessage ( ) ) ; }
Factory method for transforming an exception into an ApplicationError instance.
@param $ex Exception
@return ApplicationError
Factory method for transforming an exception into an ApplicationError instance .