Skip to content

str() on a FixedLengthError instance crashes with AttributeError #2

Open
@dargueta

Description

@dargueta
  • FWFFR version: 0.4.0
  • Python version: 3.7
  • Operating System: Ubuntu, OSX

Description

Tried calling str() on a caught exception and it blew up.

What I Did

>>> import fwffr                                                                                                                                                                                                

>>> str(fwffr.FixedLengthError("asdf"))                                                                                                                                                                         
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/diegoargueta/.pyenv/versions/3.7.6/envs/gds3/lib/python3.7/site-packages/fwffr.py", line 31, in __str__
    return self.message
AttributeError: 'FixedLengthError' object has no attribute 'message'

'FixedLengthError' object has no attribute 'message'

Either this should be an abstract base class or some tweaking is needed for rendering the error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions