Skip to content

Commit

Permalink
Merge pull request #3 from edanalytics/fix/retry_500_errors
Browse files Browse the repository at this point in the history
adding special handling for 500 errors so they could be retried
  • Loading branch information
ejoranlienea authored Jan 27, 2023
2 parents 999f0da + d1f8b79 commit 05d8fd4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# edfi_api_client v0.1.1
## Fixes
- retry on 500 errors

# edfi_api_client v0.1.0
Initial release
4 changes: 4 additions & 0 deletions edfi_api_client/edfi_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ def custom_raise_for_status(response):
"404: Resource not found.",
response=response
)
elif response.status_code == 500:
raise RequestsWarning(
"500: Internal server error."
)
elif response.status_code == 504:
raise RequestsWarning(
"504: Gateway time-out for URL. The connection may need to be reset."
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name='edfi_api_client',
version='0.1.0',
version='0.1.1',
description='Ed-Fi API client and tools',
license_files=['LICENSE'],
url='https://github.com/edanalytics/edfi_api_client',
Expand Down

0 comments on commit 05d8fd4

Please sign in to comment.