!;iTdZddlmZdZddlZddlmZGddeZ Gdd e Z Gd d e Z Gd d e Z Gdde Z Gdde ZGdde ZGdde ZGdde ZGdde ZGdde ZGdde ZGdde ZGd 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)_helpersceZdZdZdS)ErrorzBase error for this module.N__name__ __module__ __qualname____doc__JC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\googleapiclient/errors.pyrrs%%Dr rcleZdZdZejdddZedZdZ dZ e Z dS) HttpErrorz$HTTP data was invalid or unexpected.Nc||_t|tstd||_||_d|_||_dS)NzHTTP content should be bytes) resp isinstancebytes TypeErrorcontenturi error_details _get_reasonreason)selfrrrs r__init__zHttpError.__init__&sW '5)) <:;; ; &&(( r c|jjS)z6Return the HTTP status code from the response content.)rstatusrs r status_codezHttpError.status_code0syr c|jj} tj|jdn/#tj$r|jdYnwxYwttr@dd}tfddDd}|rd||_ ncttrGtdkr4d}|dd}d|dvr|dd|_ n|_ n#tttf$rYnwxYw|d}|S) z=Calculate the reason for the error from the response content.zutf-8errormessagec30K|]}|dv |VdS)r$Nr ).0kwdatas r z(HttpError._get_reason..As>g......r )detaildetailserrorsr%rrr,)rrjsonloadsrdecodeJSONDecodeErrorrdictnextrlistlen ValueErrorKeyErrorrstrip)rrerror_detail_keyword first_errorr)s @rrzHttpError._get_reason5s!  4z$,"5"5g">">??' 4 4 4|**733 4$%% *gy1'+"L  (($(M)-g7K)LD&D$'' *CIIMM"1g $W-i8 G 444)4W)=i)HD&%)"Hi0    D  >F||~~s-,=D%)A)&D%(A))B;D%%D?>D?c |jr(d|jjd|jd|jd|jd S|jr d|jjd|jd|jdSd|jjd|jdS)Nz  ")rrr rrr!s r__repr__zHttpError.__repr__Ws   K K     """   X K K       K-1I,<,<,__str__r r rrr#s..T_Q))))  X    DKKK"GGGr rceZdZdZdS)InvalidJsonErrorz&The JSON returned could not be parsed.Nrr r rrErEks00Dr rEceZdZdZdS)UnknownFileTypez File type unknown or unexpected.Nrr r rrGrGq**Dr rGceZdZdZdS)UnknownLinkTypez Link type unknown or unexpected.Nrr r rrJrJwrHr rJceZdZdZdS)UnknownApiNameOrVersionz)No API with that name and version exists.Nrr r rrLrL}s33Dr rLceZdZdZdS)UnacceptableMimeTypeErrorz4That is an unacceptable mimetype for this operation.Nrr r rrNrNs>>Dr rNceZdZdZdS)MediaUploadSizeErrorz+Media is larger than the method can accept.Nrr r rrPrPs55Dr rPceZdZdZdS)ResumableUploadErrorz'Error occurred during resumable upload.Nrr r rrRrRs11Dr rRceZdZdZdS)InvalidChunkSizeErrorz!The given chunksize is not valid.Nrr r rrTrTs++Dr rTceZdZdZdS)InvalidNotificationErrorz$The channel Notification is invalid.Nrr r rrVrVs..Dr rVcPeZdZdZejdddZdZeZdS) BatchErrorz'Error occurred during batch operations.Nc0||_||_||_dSr?)rrr)rrrrs rrzBatchError.__init__s   r crt|jdd d|jzSd|jjd|jdS)Nr zz zBatchError.__repr__sF 49h - - 5&$+6 6 6.2Y-=-=-=t{{{K Kr )NN) rr r r r@rArr>rCr r rrXrXsX11T_Q LLL GGGr rXcPeZdZdZejddfd ZxZS)UnexpectedMethodErrorz;Exception raised by RequestMockBuilder on unexpected calls.Nc^tt|d|zdS))Constructor for an UnexpectedMethodError.zReceived unexpected call %sN)superr^r)rmethodId __class__s rrzUnexpectedMethodError.__init__s: #T**33 )H 4     r r?)rr r r r@rAr __classcell__rds@rr^r^sZEET_Q          r r^c"eZdZdZfdZxZS)UnexpectedBodyErrorzFF         r rh)r __future__r __author__r.googleapiclientrr@ ExceptionrrrErGrJrLrNrPrRrTrVrXr^rhr r rrqs '&&&&& 3 ,,,,,,     I   EEEEEEEEP     u        e        e        e                5        9        E        u   $     E        %     r