From 4a52a71956a8d46fcb7294ac71734504bb09bcc2 Mon Sep 17 00:00:00 2001 From: S. Solomon Darnell Date: Fri, 28 Mar 2025 21:52:21 -0500 Subject: two version of R2R are here --- .../site-packages/azure/common/__init__.py | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .venv/lib/python3.12/site-packages/azure/common/__init__.py (limited to '.venv/lib/python3.12/site-packages/azure/common/__init__.py') diff --git a/.venv/lib/python3.12/site-packages/azure/common/__init__.py b/.venv/lib/python3.12/site-packages/azure/common/__init__.py new file mode 100644 index 00000000..6fbc7a2d --- /dev/null +++ b/.venv/lib/python3.12/site-packages/azure/common/__init__.py @@ -0,0 +1,37 @@ +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- +from ._version import VERSION as _VERSION + +__author__ = 'Microsoft Corp. ' +__version__ = _VERSION + + +class AzureException(Exception): + pass + + +class AzureHttpError(AzureException): + def __init__(self, message, status_code): + super(AzureHttpError, self).__init__(message) + self.status_code = status_code + + def __new__(cls, message, status_code, *args, **kwargs): + if cls is AzureHttpError: + if status_code == 404: + cls = AzureMissingResourceHttpError + elif status_code == 409: + cls = AzureConflictHttpError + return AzureException.__new__(cls, message, status_code, *args, **kwargs) + + +class AzureConflictHttpError(AzureHttpError): + def __init__(self, message, status_code): + super(AzureConflictHttpError, self).__init__(message, status_code) + + +class AzureMissingResourceHttpError(AzureHttpError): + def __init__(self, message, status_code): + super(AzureMissingResourceHttpError, self).__init__(message, status_code) -- cgit v1.2.3