Skip to content

Commit

Permalink
Handle contended transaction errors (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptpaterson authored Apr 25, 2023
1 parent 2451066 commit dd441bc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions faunadb/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def raise_for_status_code(request_result):
raise PermissionDenied(request_result)
elif code == codes.not_found:
raise NotFound(request_result)
elif code == codes.conflict:
raise ContendedTransaction(request_result)
elif code == codes.internal_server_error:
raise InternalError(request_result)
elif code == codes.unavailable:
Expand Down Expand Up @@ -94,6 +96,11 @@ class NotFound(HttpError):
pass


class ContendedTransaction(HttpError):
"""HTTP 409 error."""
pass


class InternalError(HttpError):
"""HTTP 500 error."""
pass
Expand Down

0 comments on commit dd441bc

Please sign in to comment.