Skip to content

Improve exception raising #112

@RobertoRoos

Description

@RobertoRoos

This followed the discussion in #108 : it would be nice if the exceptions raised by hidapi could be more easily distinguished.

This goes in two ways:

  • They should be more understandable to a human seeing the uncaught exception (e.g. "Opening the HID device failed" instead of "open failed", there seems no reason to be brief in the error message)
  • They should be easier to catch (e.g. try ... except hid.ConnectionError, instead of having to rely on the error message)

There was the discussion in the link above that renaming the exact "open failed" message would break compatibility. Do other people think this is true?

I personally it is worth taking the risk if it improves the package. If people cannot upgrade they can rely on their package manager.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions