diff --git a/src/main.py b/src/main.py index fe29275..4d2e42f 100644 --- a/src/main.py +++ b/src/main.py @@ -38,7 +38,8 @@ def post_reading(config: dict, humidity: float, temperature: float): print("Unauthorised: Trying to re-register") config["id"] = register_id(config) update_config(config) - raise Exception(f"Reading: server returned {response.status_code}: {response.reason}") + else: + raise Exception(f"Reading: server returned {response.status_code}: {response.reason}") def main(): config = load_config() @@ -56,7 +57,7 @@ def main(): try: post_reading(config, humidity, temperature) except Exception as e: - print(e.message) # Continue for now + print(e) # Continue for now sensor_fail_count = 0 else: sensor_fail_count = sensor_fail_count + 1