betamaxpy / betamax

A VCR imitation designed only for python-requests.
https://betamax.readthedocs.io/en/latest/
Other
565 stars 62 forks source link

AttributeError: 'BetamaxError' object has no attribute 'message' #143

Closed hroncok closed 6 years ago

hroncok commented 6 years ago
e = Exception('A')
>>> e.__repr__()
"Exception('A',)"
>>> import betamax
>>> be = betamax.BetamaxError('A')
>>> be.__repr__()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/churchyard/ownCloud/Škola/171/mi-pyt-kam/cviko1/__venv__/lib64/python3.6/site-packages/betamax/exceptions.py", line 6, in __repr__
    return 'BetamaxError("%s")' % self.message
AttributeError: 'BetamaxError' object has no attribute 'message'

I believe the __repr__() method is not needed on BetamaxError and removing it fixes the problem for me and works on Python 2 and Python 3 as well.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/50008276-attributeerror-betamaxerror-object-has-no-attribute-message?utm_campaign=plugin&utm_content=tracker%2F198445&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F198445&utm_medium=issues&utm_source=github).