Skip to content

Commit

Permalink
Fix MQTT connection argument validation (#513)
Browse files Browse the repository at this point in the history
* Fix MQTT connection argument validation

assert "some string" will never raise an exception

* update error type

---------

Co-authored-by: Pascal Brogle <[email protected]>
  • Loading branch information
xiazhvera and broglep-work authored Sep 13, 2023
1 parent 30d6fb2 commit 6cdd7c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion awsiot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, mqtt_connection: mqtt.Connection or mqtt5.Client):
self._mqtt_connection = mqtt_connection.new_connection()
self._mqtt5_client = mqtt_connection
else:
assert("The service client could only take mqtt.Connection and mqtt5.Client as argument")
raise TypeError("The service client could only take mqtt.Connection and mqtt5.Client as argument")

@property
def mqtt_connection(self) -> mqtt.Connection:
Expand Down

0 comments on commit 6cdd7c5

Please sign in to comment.