Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions in the Core #45

Open
hgrecco opened this issue Feb 8, 2015 · 3 comments
Open

Exceptions in the Core #45

hgrecco opened this issue Feb 8, 2015 · 3 comments

Comments

@hgrecco
Copy link
Contributor

hgrecco commented Feb 8, 2015

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?

@MatthieuDartiailh
Copy link

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.

@hgrecco
Copy link
Contributor Author

hgrecco commented Feb 8, 2015

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

@MatthieuDartiailh
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants