File: exceptions.py

package info (click to toggle)
azure-devops-cli-extension 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,384 kB
  • sloc: python: 160,782; xml: 198; makefile: 56; sh: 51
file content (41 lines) | stat: -rw-r--r-- 1,550 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from msrest.exceptions import (
    ClientException,
    ClientRequestError,
    AuthenticationError,
)


class AzureDevOpsClientError(ClientException):
    pass


class AzureDevOpsAuthenticationError(AuthenticationError):
    pass


class AzureDevOpsClientRequestError(ClientRequestError):
    pass


class AzureDevOpsServiceError(AzureDevOpsClientRequestError):
    """AzureDevOpsServiceError.
    """

    def __init__(self, wrapped_exception):
        self.inner_exception = None
        if wrapped_exception.inner_exception is not None:
            self.inner_exception = AzureDevOpsServiceError(wrapped_exception.inner_exception)
        super(AzureDevOpsServiceError, self).__init__(message=wrapped_exception.message,
                                                      inner_exception=self.inner_exception)
        self.message = wrapped_exception.message
        self.exception_id = wrapped_exception.exception_id
        self.type_name = wrapped_exception.type_name
        self.type_key = wrapped_exception.type_key
        self.error_code = wrapped_exception.error_code
        self.event_id = wrapped_exception.event_id
        self.custom_properties = wrapped_exception.custom_properties