HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/googleapiclient/__pycache__/errors.cpython-310.pyc
o

�hT�@sdZddlmZdZddlZddlmZGdd�de�Z	Gdd	�d	e	�Z
Gd
d�de	�ZGdd
�d
e	�ZGdd�de	�Z
Gdd�de	�ZGdd�de	�ZGdd�de	�ZGdd�de
�ZGdd�de	�ZGdd�de	�ZGdd�de
�ZGdd�de	�ZGd d!�d!e	�ZdS)"z_Errors for the library.

All exceptions defined by the library
should be defined in this file.
�)�absolute_importz$jcgregorio@google.com (Joe Gregorio)N)�_helpersc@�eZdZdZdS)�ErrorzBase error for this module.N��__name__�
__module__�__qualname__�__doc__�rr�I/usr/local/CyberCP/lib/python3.10/site-packages/googleapiclient/errors.pyr�rc@sDeZdZdZe�d�ddd��Zedd��Zdd	�Z	d
d�Z
e
ZdS)
�	HttpErrorz$HTTP data was invalid or unexpected.�NcCs8||_t|t�std��||_||_d|_|��|_dS)NzHTTP content should be bytes�)	�resp�
isinstance�bytes�	TypeError�content�uri�
error_details�_get_reason�reason)�selfrrrrrr�__init__&s
zHttpError.__init__cCs|jjS)z6Return the HTTP status code from the response content.)r�status�rrrr�status_code0szHttpError.status_codec
s|jj}zezt�|j�d���Wntjy |j�d��Ynwt�t�rB�dd}t	�fdd�dD�d�}|rA�d||_
n&t�t�ret��dkre�d}|dd}d	|dvrd|dd	|_
n�|_
Wnt
ttfyuYnw|d
ur|d}|��S)z=Calculate the reason for the error from the response content.zutf-8�error�messagec3s �|]}|�dvr|VqdS)rNr)�.0�kw��datarr�	<genexpr>As���z(HttpError._get_reason.<locals>.<genexpr>)�detail�details�errorsr rrr'N)rr�json�loadsr�decode�JSONDecodeErrorr�dict�nextr�list�len�
ValueError�KeyErrorr�strip)rr�error_detail_keyword�first_errorrr#rr5s@�

������zHttpError._get_reasoncCsN|jrd|jj|j|j|jfS|jrd|jj|j|jfSd|jj|jfS)Nz><HttpError %s when requesting %s returned "%s". Details: "%s">z/<HttpError %s when requesting %s returned "%s">z<HttpError %s "%s">)rrrrrrrrr�__repr__Ws��zHttpError.__repr__�N)rrr	r
�util�
positionalr�propertyrrr6�__str__rrrrr#s	
"rc@r)�InvalidJsonErrorz&The JSON returned could not be parsed.Nrrrrrr<kr
r<c@r)�UnknownFileTypez File type unknown or unexpected.Nrrrrrr=qr
r=c@r)�UnknownLinkTypez Link type unknown or unexpected.Nrrrrrr>wr
r>c@r)�UnknownApiNameOrVersionz)No API with that name and version exists.Nrrrrrr?}r
r?c@r)�UnacceptableMimeTypeErrorz4That is an unacceptable mimetype for this operation.Nrrrrrr@�r
r@c@r)�MediaUploadSizeErrorz+Media is larger than the method can accept.NrrrrrrA�r
rAc@r)�ResumableUploadErrorz'Error occurred during resumable upload.NrrrrrrB�r
rBc@r)�InvalidChunkSizeErrorz!The given chunksize is not valid.NrrrrrrC�r
rCc@r)�InvalidNotificationErrorz$The channel Notification is invalid.NrrrrrrD�r
rDc@s0eZdZdZe�d�ddd��Zdd�ZeZdS)	�
BatchErrorz'Error occurred during batch operations.�NcCs||_||_||_dSr7)rrr)rrrrrrrr�s
zBatchError.__init__cCs.t|jdd�durd|jSd|jj|jfS)Nrz<BatchError "%s">z<BatchError %s "%s">)�getattrrrrrrrrr6�s
zBatchError.__repr__)NN)	rrr	r
r8r9rr6r;rrrrrE�srEcs,eZdZdZe�d�d�fdd�	�Z�ZS)�UnexpectedMethodErrorz;Exception raised by RequestMockBuilder on unexpected calls.�Ncstt|��d|�dS)�)Constructor for an UnexpectedMethodError.zReceived unexpected call %sN)�superrHr)r�methodId��	__class__rrr�s
�zUnexpectedMethodError.__init__r7)rrr	r
r8r9r�
__classcell__rrrMrrH�srHcs eZdZdZ�fdd�Z�ZS)�UnexpectedBodyErrorz<Exception raised by RequestMockBuilder on unexpected bodies.cstt|��d||f�dS)rJzExpected: [%s] - Provided: [%s]N)rKrPr)r�expected�providedrMrrr�s

�zUnexpectedBodyError.__init__)rrr	r
rrOrrrMrrP�srP)r
�
__future__r�
__author__r)�googleapiclientrr8�	Exceptionrrr<r=r>r?r@rArBrCrDrErHrPrrrr�<module>s&H