smsapi / smsapi-python-client

SMSAPI Python client that allows you to send messages, manage Short URLs and administrate your SMSAPI account.
https://www.smsapi.com/
Other
55 stars 34 forks source link

fix unhashable type caused by SmsApiException #24

Closed martinemplo closed 4 years ago

martinemplo commented 4 years ago

If you override custom __eq__ method, you need to provide __hash__ as well. If not provided, raven crashes when handling the exception with: TypeError: unhashable type: 'SmsApiException' Minimal reproducible example:

>>> from smsapi.exception import SmsApiException
>>> try:
...     raise SmsApiException("emplocity")
... except SmsApiException as e:
...     print(hash(e))
... 
in-void commented 4 years ago

Cool, I'll keep that in mind. Thanks.