From 7883f225e8885bb6e6834d3daf62fe69e8410d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20R=C3=A4mi?= Date: Fri, 16 Aug 2019 16:32:02 +0200 Subject: [PATCH] fix(client): add raise_for_status() Drive-by commit to make the client raise an Exception if a request to caluma fails. --- caluma_interval/client.py | 1 + docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/caluma_interval/client.py b/caluma_interval/client.py index 771bda91..fc2870c5 100644 --- a/caluma_interval/client.py +++ b/caluma_interval/client.py @@ -65,4 +65,5 @@ def _send(self, query, variables): headers["Authorization"] = f"Bearer {token['access_token']}" response = requests.post(self.endpoint, json=data, headers=headers) + response.raise_for_status() return response.json() diff --git a/docker-compose.yml b/docker-compose.yml index c5fa1675..ae916089 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: command: -p ${DATABASE_PORT:-5432} caluma: - image: projectcaluma/caluma:latest@sha256:ec73722c9d40e3786309de7d3885bef80558932bbfdf0b34701b11d997241e8a + image: projectcaluma/caluma:latest@sha256:2b6a219a720b53d87026becd79918ba04b8f047f52371564667debdea9515517 ports: - "8000:8000" depends_on: