Skip to content

Commit a354300

Browse files
Added 451 status code exception
Resolves: sigmavirus24#590
1 parent 7bb022a commit a354300

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

github3/exceptions.py

+6
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ class ServerError(ResponseError):
130130
pass
131131

132132

133+
class UnavailableForLegalReasons(ResponseError):
134+
"""Exception class for 451 responses."""
135+
pass
136+
137+
133138
error_classes = {
134139
400: BadRequest,
135140
401: AuthenticationFailed,
@@ -138,6 +143,7 @@ class ServerError(ResponseError):
138143
405: MethodNotAllowed,
139144
406: NotAcceptable,
140145
422: UnprocessableEntity,
146+
451: UnavailableForLegalReasons,
141147
}
142148

143149

0 commit comments

Comments
 (0)