8000 Added exception for HTTP 409 error · pythonthings/github3.py@5254bfe · GitHub
[go: up one dir, main page]

Skip to content

Commit 5254bfe

Browse files
author
Jan Priessnitz
committed
Added exception for HTTP 409 error
Github returns error 409 when the head branch was modified and SHA sums do not match
1 parent b58ff53 commit 5254bfe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

github3/exceptions.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ class NotAcceptable(ResponseError):
115115
pass
116116

117117

118+
class Conflict(ResponseError):
119+
"""Exception class for 409 responses.
120+
121+
Possible reasons:
122+
123+
- Head branch was modified (SHA sums do not match)
124+
"""
125+
pass
126+
127+
118128
class UnprocessableEntity(ResponseError):
119129
"""Exception class for 422 responses."""
120130
pass
@@ -142,6 +152,7 @@ class UnavailableForLegalReasons(ResponseError):
142152
404: NotFoundError,
143153
405: MethodNotAllowed,
144154
406: NotAcceptable,
155+
409: Conflict,
145156
422: UnprocessableEntity,
146157
451: UnavailableForLegalReasons,
147158
}

0 commit comments

Comments
 (0)
0