Skip to content

Exceptions in the Core #45

Open
Open

Description

@hgrecco

I think is a really good opportunity to think again the exception hierarchy in Lantz.

Right now we have the following errors:

  • InvalidCommand: The command send to the instrument was invalid.
  • LantzTimeoutError: A timeout occurred. Used to have a single error abstracting the differences in lower level libraries
  • InstrumentError: Generic error
  • NotSupportedError: The interface is not supported by this instrument

Maybe it could be reworked as
LantzError: Generic Error

And deriving from this:

  • InvalidCommand
  • TimeoutError
  • InterfaceNotSupported

Another question? Do we need to reraise pyvisa (or other libraries) exceptions?

Activity

  1. MatthieuDartiailh commented on Feb 8, 2015

    @MatthieuDartiailh

    I like your proposal. I will have to think about what to do about the notion of communication safety I use in Eapii (and which a requirement of some of my users). The idea is basically that is an operation fails without apparent reason (unexpected timeout) it may be worth trying again after reopening the connection because some instruments are dumb.

  2. hgrecco commented on Feb 8, 2015

    @hgrecco
    ContributorAuthor

    Some instruments are indeed dumb. But we need to make this somehow opt-in. Maybe with a retry flag?

  3. MatthieuDartiailh commented on Feb 8, 2015

    @MatthieuDartiailh

    Agreed for the time being, retry behavior is specified at the IProperty level and is then specified for all driver of the type, we could have a boolean flag at the instance level to de-activate this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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