Skip to content

Commit

Permalink
handle ConnectionError on MADdev API connections (Map-A-Droid#1340)
Browse files Browse the repository at this point in the history
* fixes /apk endpoint returning 500 when MADDev API is unreachable
  • Loading branch information
crhbetz authored Apr 16, 2023
1 parent 778e497 commit 5fda46d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mapadroid/mad_apk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ async def supported_pogo_version(architecture: APKArch, version: str, token: Opt
except NoMaddevApiTokenError:
logger.warning("Maddev API token is not set, assuming a supported version being used.")
return True
except ConnectionError:
logger.warning("Error connecting to MADdev, assuming a supported version being used.")
return True
if version in supported_versions.get(bits, []):
return True
# If the version is not supported, check the local
Expand Down Expand Up @@ -310,6 +313,9 @@ async def get_supported_pogo(architecture: APKArch, token: Optional[str]) -> Dic
except NoMaddevApiTokenError:
logger.warning("Maddev API token is not set and no local version_codes.json defined.")
raise
except ConnectionError:
logger.warning("Error connecting to MADdev!")
raise
return await translate_pogo_versions(supported_versions)


Expand Down

0 comments on commit 5fda46d

Please sign in to comment.