a f"@sddlZddlZddlmZddlmZddlmZ deZ eZ de de d Z Gd d d e ZGd d d eZGddde ZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGd d!d!eZGd"d#d#eZGd$d%d%e ZGd&d'd'e ZGd(d)d)eZGd*d+d+e ZGd,d-d-eZGd.d/d/e ZGd0d1d1e Z Gd2d3d3e Z!dS)4N) __version__)RequestException)ConnectTimeoutzOracle-PythonSDK/zClient Version: z, OS Version: z, See https://docs.oracle.com/iaas/Content/API/Concepts/sdk_troubleshooting.htm for common issues and steps to resolve them. If you need to contact support, or file a GitHub issue, please include this full error message.cs(eZdZdZfddZddZZS) ServiceErrorz'The service returned an error response.c sx||_||_||_||_|d|_||_|d|_|d|_ |d|_ |d|_ |d|_ |d|_ dt|jd t|jd t|d }d |j d }|sd|j}|j |||j||j|j |j |j dd }|j r|d|j d||d<n|d||d<t|dtrdtj|d} | D]\} } | |vrF| || <qFtt||dS)Noriginal_requestoperation_nameapi_reference_linktarget_servicerequest_endpointclient_version timestampzPSee https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors____z1 for more information about resolving this error.z"If you are unable to resolve this zO issue, please contact Oracle support and provide them this full error message.z"The service returned error code %szTo get more info on the failing request, refer to https://docs.oracle.com/en-us/iaas/tools/python/latest/logging.html for ways to log the request/response details.) r statuscodeopc-request-idmessagerr r r Z logging_tipsz Also see z/ for details on this operation's requirements. Ztroubleshooting_tips deserialized_data)rrheadersrgetr_get_opc_request_idZ request_idrr r r r r strlower isinstancedictociutilZcamel_to_snake_keysitemssuperr__init__) selfrrrrkwargsZapi_errors_infoZ contact_infoZ error_detailsrkeyvalue __class__2/usr/lib/python3.9/site-packages/oci/exceptions.pyr!sH        ,    zServiceError.__init__cCs<|jdr|jdS|jr4|jjr4|jjdSdSdS)Nr)rrrZ header_paramsr"r(r(r)rBs   z ServiceError._get_opc_request_id)__name__ __module__ __qualname____doc__r!r __classcell__r(r(r&r)rs 0rc@seZdZdZdS)TransientServiceErrorz"A transient service error occurredNr+r,r-r.r(r(r(r)r0Ksr0c@seZdZdZdS) ClientErrorzA client-side error occurred..Nr1r(r(r(r)r2Osr2c@seZdZdZdS)ConfigFileNotFoundzConfig file not be found.Nr1r(r(r(r)r3Ssr3c@s eZdZdZddZddZdS) InvalidConfigzThe config object is missing required keys or contains malformed values. For example: .. code-block:: python raise InvalidConfig({ "region": "missing", "key_id": "malformed' }) cCs ||_dS)z':param errors: {config key: error code}N)errors)r"r5r(r(r)r!cszInvalidConfig.__init__cCs t|jSN)rr5r*r(r(r)__str__gszInvalidConfig.__str__N)r+r,r-r.r!r7r(r(r(r)r4Ws r4c@seZdZdZdS)InvalidAlloyConfigz1Alloy config is invalid, or is blocking a serviceNr1r(r(r(r)r8ksr8c@seZdZdZdS)!InvalidResourcePrincipalArgumentszThe ResourceId is missing.Nr1r(r(r(r)r9osr9c@seZdZdZdS)InvalidPrivateKeyzOThe provided key is not a private key, or the provided passphrase is incorrect.Nr1r(r(r(r)r:ssr:c@seZdZdZdS)MissingPrivateKeyPassphrasez'The provided key requires a passphrase.Nr1r(r(r(r)r;wsr;c@seZdZdZdS)InvalidKeyFilePathzKThe value is expected to be a file name but it's not a valid key_file path.Nr1r(r(r(r)r<{sr<c@seZdZdZdS)ProfileNotFoundz7The specified profile was not found in the config file.Nr1r(r(r(r)r=sr=c@seZdZdZdS)WaitUntilNotSupportedz-wait_until is not supported by this response.Nr1r(r(r(r)r>sr>c@seZdZdZdS)MaximumWaitTimeExceededz$Maximum wait time has been exceeded.Nr1r(r(r(r)r?sr?cs eZdZdZfddZZS)MultipartUploadErrorz Exception thrown when an error with a multipart upload occurs. As multipart uploads can be parallelised, this error contains a collection of errors which caused individual part uploads to fail c sRg|_d|vr0|ds0|j|dqdt|_tt||jdS)z :param queue error_causes_queue: A queue containing errors which occured during the multipart upload Zerror_causes_queuez-MultipartUploadError exception has occurred. N) Z error_causesemptyappendr$UPLOAD_MANAGER_DEBUG_INFORMATION_LOGrr Exceptionr!)r"r#r&r(r)r!s   zMultipartUploadError.__init__)r+r,r-r.r!r/r(r(r&r)r@sr@c@seZdZdZgdfddZdS)CompositeOperationErrora- An exception occurred during a composite operation (e.g. launching an instance and waiting for state) but part of the composite operation succeeded. This exception has the following attributes: :var list partial_results: Any partial results which are available (e.g. if the :py:meth:`~oci.core.ComputeClient.launch_instance` succeeded and the waiting for state failed then this will contain the :py:meth:`~oci.core.ComputeClient.launch_instance` result) :var Exception cause: The exception which caused the composite operation to fail NcCs||_||_dSr6)partial_resultscause)r"rFrGr(r(r)r!sz CompositeOperationError.__init__r+r,r-r.r!r(r(r(r)rEsrEc@seZdZdZdS)rz-An exception occurred when making the requestNr1r(r(r(r)rsrc@seZdZdZdS)rzThe request timed out while trying to connect to the remote server. Requests that produced this error are safe to retry. Nr1r(r(r(r)rsrc@seZdZdZdS)/MissingEndpointForNonRegionalServiceClientErrorzXNo endpoint value was provided when trying to create a non-regional service client. Nr1r(r(r(r)rIsrIc@seZdZdZdS)DownloadTerminateda" This exception is raised by DownloadManager.get_object_to_path and DownloadManager.get_object_to_stream when a download is terminated in between. This is generally raised when the download manager's state is changed to -1, indicating that the download is to be terminated. Nr1r(r(r(r)rJsrJc@seZdZdZddZdS)ResumableDownloadExceptionzR This exception is raised when in a multipart download some parts failed. cCs||_||_||_||_dSr6)namespace_name bucket_name object_name failed_parts)r"rLrMrNrOr(r(r)r!sz#ResumableDownloadException.__init__NrHr(r(r(r)rKsrKc@seZdZdZddZdS)#DownloadFailedIncorrectDownloadSizez This exception is raised when the final integrity check (comparing the actual bytes downloaded with the object size in bytes) fails. cCs"||_||_d|d||_dS)NzDThe downloaded file didn't match the object size in bytes: expected z, got )actual_bytes_downloaded object_sizer)r"rQrRr(r(r)r!s z,DownloadFailedIncorrectDownloadSize.__init__NrHr(r(r(r)rPsrP)"platformZoci.utilrversionrZoci._vendor.requests.exceptionsrZBaseRequestExceptionrZBaseConnectTimeoutZCLIENT_VERSIONZ OS_VERSIONrCrDrr0r2r3r4r8r9r:r;r<r=r>r?r@rE ValueErrorrIrJrKrPr(r(r(r)s8    <