Skip to content

Commit

Permalink
more gracefully handle BGG API 503 response
Browse files Browse the repository at this point in the history
  • Loading branch information
boldandbrad committed Jan 5, 2024
1 parent 9a27bf2 commit 3530559
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to

## [Unreleased]

## [v1.3.1] - 2024-01-05

### Fixed

- `API` - More gracefully handle BGG API 503 response

## [v1.3.0] - 2023-12-29

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/meeple/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Local board game collection manager. Powered by BoardGameGeek."""

# release version
__version__ = "1.3.0"
__version__ = "1.3.1"
5 changes: 5 additions & 0 deletions src/meeple/util/api_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ def _bgg_xml2_api_get(endpoint: str, params: dict = {}) -> List[Item]:
error_msg(
"BoardGameGeek API rate limit exceeded. Please try again later."
)
case 503:

Check warning on line 67 in src/meeple/util/api_util.py

View check run for this annotation

Codecov / codecov/patch

src/meeple/util/api_util.py#L67

Added line #L67 was not covered by tests
# api unavailable/undergoing maintanence
error_msg(

Check warning on line 69 in src/meeple/util/api_util.py

View check run for this annotation

Codecov / codecov/patch

src/meeple/util/api_util.py#L69

Added line #L69 was not covered by tests
"BoardGameGeek API is currently down for maintenance. Please try again later."
)
case _:
# unknown api error
# TODO: log this error and print out a friendlier message to the user
Expand Down

0 comments on commit 3530559

Please sign in to comment.