The errors module

Custom-defined exceptions.

The following custom-defined exceptions are defined in this module.

InstrumentInUseError
Raised when a user attempts to delete an instrument which is still used by an action in the sequence.
InvalidInputError
Raised when a user enters an input value which is not of the right type.

Classes

InstrumentInUseError

class src.core.errors.InstrumentInUseError(actions)[source]

Error for when an attempt is made to delete a still-bound instrument.

Parameters :

actions : list of Action

A list of the actions which require the instrument the user is trying to delete.

InvalidInputError

class src.core.errors.InvalidInputError(msg, valueName, val)[source]

An error raised when an action cannot coerce an input to the right type.

This exception subsumes TypeError and ValueError so that they can be caught more easily by programs which set input values for actions, and so that it is easier for those programs to know precisely whence the error comes.

Parameters :

msg : str

The message generated by the object which raises the exception.

valueName : str

The description of the input or output parameter for which an invalid value was received.

val : str

The invalid input supplied for the parameter.

GeneralExperimentError

class src.core.errors.GeneralExperimentError(items)[source]

An exception generated in response to miscellaneous problems.

Parameters :

items : list of tuple of str

A list of tuples. Each tuple contains information about one error in the form of two strings. The first is the severity and may be either ‘warning’, which will allow the experiment to proceed if the user commands it, or ‘error’, which will not allow the experiment to proceed. The second is a message about the error.

Attributes

msg str A basic string: ‘Errors have been found.’
items list of tuple of str The same as items from the Parameters section.
errorCount int The number of elements of items which are ‘error’s rather than mere ‘warning’s.

Null

class src.core.errors.Null(*args, **kwargs)[source]

Fake VISA driver.

This class is here so that the program will run even on a computer without VISA drivers installed.

Table Of Contents

Previous topic

The graph module

Next topic

The progress module

This Page