From 3530559008a17820634122d2dac3875feda7b71c Mon Sep 17 00:00:00 2001 From: Bradley Wojcik Date: Fri, 5 Jan 2024 18:07:14 -0500 Subject: [PATCH] more gracefully handle BGG API 503 response --- docs/changelog.md | 6 ++++++ src/meeple/__init__.py | 2 +- src/meeple/util/api_util.py | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 8bfa388..585f823 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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 diff --git a/src/meeple/__init__.py b/src/meeple/__init__.py index 42a9301..ca81b12 100644 --- a/src/meeple/__init__.py +++ b/src/meeple/__init__.py @@ -1,4 +1,4 @@ """Local board game collection manager. Powered by BoardGameGeek.""" # release version -__version__ = "1.3.0" +__version__ = "1.3.1" diff --git a/src/meeple/util/api_util.py b/src/meeple/util/api_util.py index b47e1c8..0866241 100644 --- a/src/meeple/util/api_util.py +++ b/src/meeple/util/api_util.py @@ -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: + # api unavailable/undergoing maintanence + error_msg( + "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