Skip to content

Commit

Permalink
Fixed exception issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmccans committed Aug 5, 2022
1 parent 23e102a commit fc2ddc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [1.2.0] - 2022-07-12
## [1.2.0] - 2022-08-05
### NEW
* Firmware version displayed on device details page.

Expand Down
8 changes: 4 additions & 4 deletions src/airthings.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ async def get_info(self):
_LOGGER.warning("Error getting {}".format(characteristic.name))
self.devices[mac] = device
else:
raise "Could not connect to {}".format(mac)
raise Exception("Could not connect to {}".format(mac))
except Exception as e:
_LOGGER.exception("Error getting device info for {}: {}".format(mac, e))
finally:
Expand All @@ -294,11 +294,11 @@ async def get_sensors(self):
sensor_characteristics.append(characteristic)
self.sensors[mac] = sensor_characteristics
else:
raise "Could not connect to {}".format(mac)
raise Exception("Could not connect to {}".format(mac))
except Exception as e:
_LOGGER.exception("Error getting sensors for {}: {}".format(mac, e))
finally:
await self.disconnect()
await self.disconnect()

return self.sensors

Expand Down Expand Up @@ -342,7 +342,7 @@ async def get_sensor_data(self):
else:
self.sensordata[mac].update(sensor_data)
else:
raise "Could not connect to {}".format(mac)
raise Exception("Could not connect to {}".format(mac))
except Exception as e:
_LOGGER.exception("Error getting sensor data for '{}': {}".format(mac, e))

Expand Down

0 comments on commit fc2ddc5

Please sign in to comment.