Fix error

This commit is contained in:
James H
2022-08-08 22:09:25 +01:00
parent 8220f396c5
commit ea3d0807d5

View File

@@ -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