diff --git a/royalpack/commands/pug.py b/royalpack/commands/pug.py index 97b66834..6846212b 100644 --- a/royalpack/commands/pug.py +++ b/royalpack/commands/pug.py @@ -16,6 +16,8 @@ class PugCommand(rc.Command): async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None: async with aiohttp.ClientSession() as session: async with session.get("https://dog.ceo/api/breed/pug/images/random") as response: + if response.status >= 400: + raise rc.ExternalError(f"Request returned {response.status}") result = await response.json() assert "status" in result assert result["status"] == "success"