File: //opt/gsutil/third_party/apitools/apitools/base/py/__pycache__/exceptions.cpython-39.pyc
a
�z�g� � @ s� d Z G dd� de�ZG dd� dee�ZG dd� de�ZG dd� de�ZG d d
� d
e�ZG dd� de�ZG d
d� de�Z G dd� de �Z
G dd� de �ZG dd� de �ZG dd� de �Z
G dd� de �Ze
eee
ed�ZG dd� de�ZG dd� dee�ZG dd� de�ZG d d!� d!e�ZG d"d#� d#e�ZG d$d%� d%e�ZG d&d'� d'e�ZG d(d)� d)e�ZG d*d+� d+e�ZG d,d-� d-e�ZG d.d/� d/e�ZG d0d1� d1e�ZG d2d3� d3e �ZG d4d5� d5e �ZG d6d7� d7e�ZG d8d9� d9e�Zd:S );z*Exceptions for generated client libraries.c @ s e Zd ZdZdS )�ErrorzBase class for all exceptions.N��__name__�
__module__�__qualname__�__doc__� r r �?/opt/gsutil/third_party/apitools/apitools/base/py/exceptions.pyr s r c @ s e Zd ZdZdS )�TypecheckErrorz+An object of an incorrect type is provided.Nr r r r r r s r c @ s e Zd ZdZdS )�
NotFoundErrorz(A specified resource could not be found.Nr r r r r r
s r
c @ s e Zd ZdZdS )� UserErrorz,Base class for errors related to user input.Nr r r r r r # s r c @ s e Zd ZdZdS )�InvalidDataErrorz&Base class for any invalid data error.Nr r r r r r ( s r c @ s e Zd ZdZdS )�CommunicationErrorz1Any communication error talking to an API server.Nr r r r r r
- s r
c sN e Zd ZdZd
� fdd� Zdd� Zedd� �Zed d
� �Z e
dd� �Z� ZS )� HttpErrorz-Error making a request. Soon to be HttpError.Nc s@ t �|||�}tt | ��|� || _|| _|| _|| _|| _d S �N) r �_build_message�super�__init__�response�content�url�
method_config�request)�selfr r r r r �
error_message�� __class__r r r 6 s zHttpError.__init__c C s t �| j| j| j�S r )r r r r r �r r r r �__str__@ s zHttpError.__str__c C s$ t |t�r|�dd�}d|| |f S )N�ascii�replacez6HttpError accessing <%s>: response: <%s>, content <%s>)�
isinstance�bytes�decode)r r r r r r r C s
�zHttpError._build_messagec C s t | jd �S �N�status)�intr r r r r �status_codeJ s zHttpError.status_codec K sR z t |j�d��}t�|| �}W n ty6 | }Y n0 ||j|j|jfi |��S r# )r% �info�get�_HTTP_ERRORS�
ValueErrorr �request_url)�cls�
http_response�kwargsr&