strongdm.errors

 1# Copyright 2020 StrongDM Inc
 2#
 3# Licensed under the Apache License, Version 2.0 (the "License");
 4# you may not use this file except in compliance with the License.
 5# You may obtain a copy of the License at
 6#
 7#     http://www.apache.org/licenses/LICENSE-2.0
 8#
 9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15# Code generated by protogen. DO NOT EDIT.
16
17
18class RPCError(Exception):
19    '''A generic RPC error'''
20    def __init__(self, msg, code):
21        self.msg = msg
22        self.code = code
23
24
25class AlreadyExistsError(RPCError):
26    '''Used when an entity already exists in the system'''
27    def __init__(self, msg):
28        super().__init__(msg, 6)
29
30
31class NotFoundError(RPCError):
32    '''Used when an entity does not exist in the system'''
33    def __init__(self, msg):
34        super().__init__(msg, 5)
35
36
37class BadRequestError(RPCError):
38    '''Identifies a bad request sent by the client'''
39    def __init__(self, msg):
40        super().__init__(msg, 3)
41
42
43class AuthenticationError(RPCError):
44    '''Used to specify an authentication failure condition'''
45    def __init__(self, msg):
46        super().__init__(msg, 16)
47
48
49class PermissionError(RPCError):
50    '''Used to specify a permissions violation'''
51    def __init__(self, msg):
52        super().__init__(msg, 7)
53
54
55class InternalError(RPCError):
56    '''Used to specify an internal system error'''
57    def __init__(self, msg):
58        super().__init__(msg, 13)
59
60
61class RateLimitError(RPCError):
62    '''Used when rate limit is exceeded'''
63    def __init__(self, msg, rate_limit):
64        super().__init__(msg, 8)
65        self.rate_limit = rate_limit
66
67
68class TimeoutError(RPCError):
69    '''Used when a request takes too long'''
70    def __init__(self):
71        super().__init__('deadline exceeded', 4)
72
73
74class UnknownError(RPCError):
75    '''Generic wrapper that indicates an unknown internal error in the SDK.'''
76    def __init__(self, msg):
77        super().__init__(msg, 2)
class RPCError(builtins.Exception):
19class RPCError(Exception):
20    '''A generic RPC error'''
21    def __init__(self, msg, code):
22        self.msg = msg
23        self.code = code

A generic RPC error

RPCError(msg, code)
21    def __init__(self, msg, code):
22        self.msg = msg
23        self.code = code
Inherited Members
builtins.BaseException
with_traceback
args
class AlreadyExistsError(RPCError):
26class AlreadyExistsError(RPCError):
27    '''Used when an entity already exists in the system'''
28    def __init__(self, msg):
29        super().__init__(msg, 6)

Used when an entity already exists in the system

AlreadyExistsError(msg)
28    def __init__(self, msg):
29        super().__init__(msg, 6)
Inherited Members
builtins.BaseException
with_traceback
args
class NotFoundError(RPCError):
32class NotFoundError(RPCError):
33    '''Used when an entity does not exist in the system'''
34    def __init__(self, msg):
35        super().__init__(msg, 5)

Used when an entity does not exist in the system

NotFoundError(msg)
34    def __init__(self, msg):
35        super().__init__(msg, 5)
Inherited Members
builtins.BaseException
with_traceback
args
class BadRequestError(RPCError):
38class BadRequestError(RPCError):
39    '''Identifies a bad request sent by the client'''
40    def __init__(self, msg):
41        super().__init__(msg, 3)

Identifies a bad request sent by the client

BadRequestError(msg)
40    def __init__(self, msg):
41        super().__init__(msg, 3)
Inherited Members
builtins.BaseException
with_traceback
args
class AuthenticationError(RPCError):
44class AuthenticationError(RPCError):
45    '''Used to specify an authentication failure condition'''
46    def __init__(self, msg):
47        super().__init__(msg, 16)

Used to specify an authentication failure condition

AuthenticationError(msg)
46    def __init__(self, msg):
47        super().__init__(msg, 16)
Inherited Members
builtins.BaseException
with_traceback
args
class PermissionError(RPCError):
50class PermissionError(RPCError):
51    '''Used to specify a permissions violation'''
52    def __init__(self, msg):
53        super().__init__(msg, 7)

Used to specify a permissions violation

PermissionError(msg)
52    def __init__(self, msg):
53        super().__init__(msg, 7)
Inherited Members
builtins.BaseException
with_traceback
args
class InternalError(RPCError):
56class InternalError(RPCError):
57    '''Used to specify an internal system error'''
58    def __init__(self, msg):
59        super().__init__(msg, 13)

Used to specify an internal system error

InternalError(msg)
58    def __init__(self, msg):
59        super().__init__(msg, 13)
Inherited Members
builtins.BaseException
with_traceback
args
class RateLimitError(RPCError):
62class RateLimitError(RPCError):
63    '''Used when rate limit is exceeded'''
64    def __init__(self, msg, rate_limit):
65        super().__init__(msg, 8)
66        self.rate_limit = rate_limit

Used when rate limit is exceeded

RateLimitError(msg, rate_limit)
64    def __init__(self, msg, rate_limit):
65        super().__init__(msg, 8)
66        self.rate_limit = rate_limit
Inherited Members
builtins.BaseException
with_traceback
args
class TimeoutError(RPCError):
69class TimeoutError(RPCError):
70    '''Used when a request takes too long'''
71    def __init__(self):
72        super().__init__('deadline exceeded', 4)

Used when a request takes too long

TimeoutError()
71    def __init__(self):
72        super().__init__('deadline exceeded', 4)
Inherited Members
builtins.BaseException
with_traceback
args
class UnknownError(RPCError):
75class UnknownError(RPCError):
76    '''Generic wrapper that indicates an unknown internal error in the SDK.'''
77    def __init__(self, msg):
78        super().__init__(msg, 2)

Generic wrapper that indicates an unknown internal error in the SDK.

UnknownError(msg)
77    def __init__(self, msg):
78        super().__init__(msg, 2)
Inherited Members
builtins.BaseException
with_traceback
args