private static function applicationErrorToException($error) {
    switch($error->getApplicationError()) {
      case ErrorCode::URL_TOO_LONG:
        $result = new \InvalidArgumentException(
            'The upload URL supplied was too long.');
        break;
      case ErrorCode::PERMISSION_DENIED:
        $result = new CloudStorageException('Permission Denied');
        break;
      case ErrorCode::ARGUMENT_OUT_OF_RANGE:
        $result = new \InvalidArgumentException($error->getMessage());
        break;
      default:
        $result = new CloudStorageException(
            'Error Code: ' . $error->getApplicationError());
    }
    return $result;
  }
private static function applicationErrorToException($error) {
    switch($error->getApplicationError()) {
      case ErrorCode::URL_TOO_LONG:
        $result = new \InvalidArgumentException(
            'The upload URL supplied was too long.');
        break;
      case ErrorCode::PERMISSION_DENIED:
        $result = new CloudStorageException('Permission Denied');
        break;
      case ErrorCode::ARGUMENT_OUT_OF_RANGE:
        $result = new \InvalidArgumentException($error->getMessage());
        break;
      default:
        $result = new CloudStorageException(
            'Error Code: ' . $error->getApplicationError());
    }
    return $result;
  }
private static function applicationErrorToException ( $ error ) { switch ( $ error -> getApplicationError ( ) ) { case ErrorCode :: URL_TOO_LONG : $ result = new \ InvalidArgumentException ( 'The upload URL supplied was too long.' ) ; break ; case ErrorCode :: PERMISSION_DENIED : $ result = new CloudStorageException ( 'Permission Denied' ) ; break ; case ErrorCode :: ARGUMENT_OUT_OF_RANGE : $ result = new \ InvalidArgumentException ( $ error -> getMessage ( ) ) ; break ; default : $ result = new CloudStorageException ( 'Error Code: ' . $ error -> getApplicationError ( ) ) ; } return $ result ; }
Convert an BlobstoreServiceError returned from an RPC call to an
exception.

@param int $error A BlobstoreServiceError::ErrorCode error value.

@return Exception The exception that corresponds to the error code.

@access private
Convert an BlobstoreServiceError returned from an RPC call to an exception .