From 41ab6ef24a14f88e3cabaaf34a0dc2dac5412abb Mon Sep 17 00:00:00 2001 From: "Oscar Landry L." <594529+moas@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:11:50 +0200 Subject: [PATCH] check http error occurred --- pyoscar/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyoscar/__init__.py b/pyoscar/__init__.py index e9bd31a..e1d427f 100644 --- a/pyoscar/__init__.py +++ b/pyoscar/__init__.py @@ -145,6 +145,8 @@ def get_stations(self, program: str = None, country: str = None, LOGGER.debug(f'Request: {response.url}') LOGGER.debug(f'Response: {response.status_code}') + response.raise_for_status() + return response.json() def get_contact(self, country: str, surname: str,