-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SEA-1683] Fix retry mechanism for 400 errors (#53)
We were unnecessarily retrying on all 400 errors except 401. This change should fix the issue.
- Loading branch information
Showing
3 changed files
with
40 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class CompassClientError(Exception): | ||
"""Exception raised for all 4xx client errors in the Compass client.""" | ||
|
||
def __init__(self, message="Client error occurred."): | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
|
||
class CompassAuthError(CompassClientError): | ||
"""Exception raised for authentication errors in the Compass client.""" | ||
|
||
def __init__( | ||
self, | ||
message=("CompassAuthError - check your bearer token or username and password."), | ||
): | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
|
||
class CompassMaxErrorRateExceeded(Exception): | ||
"""Exception raised when the error rate exceeds the maximum allowed error rate in | ||
the Compass client.""" | ||
|
||
def __init__( | ||
self, | ||
message="The maximum error rate was exceeded. Stopping the insertion process.", | ||
): | ||
self.message = message | ||
super().__init__(self.message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "compass-sdk" | ||
version = "0.5.0" | ||
version = "0.5.1" | ||
authors = [] | ||
description = "Compass SDK" | ||
|
||
|