diff options
author | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
---|---|---|
committer | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
commit | 4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch) | |
tree | ee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/azure/common/__init__.py | |
parent | cc961e04ba734dd72309fb548a2f97d67d578813 (diff) | |
download | gn-ai-master.tar.gz |
Diffstat (limited to '.venv/lib/python3.12/site-packages/azure/common/__init__.py')
-rw-r--r-- | .venv/lib/python3.12/site-packages/azure/common/__init__.py | 37 |
1 files changed, 37 insertions, 0 deletions
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. <azpysdkhelp@microsoft.com>' +__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) |