Skip to content

Consider using specific exceptions rather than generic Exception #15

Closed
@xylar

Description

@xylar

I don't find the exceptions raised by jigsawpy to be very intuitive, and I think that might be true for most python users.

As an example:

raise Exception("Incorrect type: NAME.")

I would expect something like:

    if (not isinstance(name, str)):
        raise TypeError("Argument 'name' to savemsh should be of type str")

As I understand it, the generic Exception class is only intended as a base class for exceptions and shouldn't be used directly.

Python is case sensitive so the use of NAME here also led to some confusion for me.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions