Source code for openbci_interface.exception

"""Defines exceptions commonly used in open_bci module."""


[docs]class BCIException: """Base exception for OpenBCI Interface specific exception.""" pass
[docs]class UnexpectedMessageFormat(BCIException, ValueError): """Board returned message not in OpenBCI format""" def __init__(self, message): super().__init__( 'Device returned a message not in OpenBCI format; %s' % message)
[docs]class NotSupported(BCIException, NotImplementedError): """Unsupported board type was requested""" def __init__(self, board_type): super().__init__('Unsupported device; %s.' % board_type)
[docs]class DeviceNotConnected(BCIException, RuntimeError): """Serial is working but board is not connected""" pass
[docs]class SampleAcquisitionTimeout(BCIException, RuntimeError): """Sample acuisition timed out.""" pass