@@ -9,12 +9,14 @@ class SCIMClientError(Exception):
9
9
caused the exception.
10
10
"""
11
11
12
- def __init__ (self , message : str , source : Any = None , * args , ** kwargs ):
12
+ def __init__ (
13
+ self , message : str , source : Any = None , * args : Any , ** kwargs : Any
14
+ ) -> None :
13
15
self .message = message
14
16
self .source = source
15
17
super ().__init__ (* args , ** kwargs )
16
18
17
- def __str__ (self ):
19
+ def __str__ (self ) -> str :
18
20
return self .message or "UNKNOWN"
19
21
20
22
@@ -29,7 +31,7 @@ class RequestNetworkError(SCIMRequestError):
29
31
The original :class:`~httpx.RequestError` is available with :attr:`~BaseException.__cause__`.
30
32
"""
31
33
32
- def __init__ (self , * args , ** kwargs ) :
34
+ def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
33
35
message = kwargs .pop ("message" , "Network error happened during request" )
34
36
super ().__init__ (message , * args , ** kwargs )
35
37
@@ -54,7 +56,7 @@ class RequestPayloadValidationError(SCIMRequestError):
54
56
print("Original validation error cause", exc.__cause__)
55
57
"""
56
58
57
- def __init__ (self , * args , ** kwargs ) :
59
+ def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
58
60
message = kwargs .pop ("message" , "Server request payload validation error" )
59
61
super ().__init__ (message , * args , ** kwargs )
60
62
@@ -69,7 +71,7 @@ class SCIMResponseErrorObject(SCIMResponseError):
69
71
Those errors are only raised when the :code:`raise_scim_errors` parameter is :data:`True`.
70
72
"""
71
73
72
- def __init__ (self , obj , * args , ** kwargs ) :
74
+ def __init__ (self , obj : Any , * args : Any , ** kwargs : Any ) -> None :
73
75
message = kwargs .pop (
74
76
"message" , f"The server returned a SCIM Error object: { obj } "
75
77
)
@@ -79,7 +81,7 @@ def __init__(self, obj, *args, **kwargs):
79
81
class UnexpectedStatusCode (SCIMResponseError ):
80
82
"""Error raised when a server returned an unexpected status code for a given :class:`~scim2_models.Context`."""
81
83
82
- def __init__ (self , status_code : int , * args , ** kwargs ) :
84
+ def __init__ (self , status_code : int , * args : Any , ** kwargs : Any ) -> None :
83
85
message = kwargs .pop (
84
86
"message" , f"Unexpected response status code: { status_code } "
85
87
)
@@ -89,15 +91,15 @@ def __init__(self, status_code: int, *args, **kwargs):
89
91
class UnexpectedContentType (SCIMResponseError ):
90
92
"""Error raised when a server returned an unexpected `Content-Type` header in a response."""
91
93
92
- def __init__ (self , content_type , * args , ** kwargs ) :
94
+ def __init__ (self , content_type : str , * args : Any , ** kwargs : Any ) -> None :
93
95
message = kwargs .pop ("message" , f"Unexpected content type: { content_type } " )
94
96
super ().__init__ (message , * args , ** kwargs )
95
97
96
98
97
99
class UnexpectedContentFormat (SCIMResponseError ):
98
100
"""Error raised when a server returned a response in a non-JSON format."""
99
101
100
- def __init__ (self , * args , ** kwargs ) :
102
+ def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
101
103
message = kwargs .pop ("message" , "Unexpected response content format" )
102
104
super ().__init__ (message , * args , ** kwargs )
103
105
@@ -117,6 +119,6 @@ class ResponsePayloadValidationError(SCIMResponseError):
117
119
print("Original validation error cause", exc.__cause__)
118
120
"""
119
121
120
- def __init__ (self , * args , ** kwargs ) :
122
+ def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
121
123
message = kwargs .pop ("message" , "Server response payload validation error" )
122
124
super ().__init__ (message , * args , ** kwargs )
0 commit comments