diff --git a/docs/release-notes.rst b/docs/release-notes.rst index f05ffe0..5c1da9b 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -22,6 +22,7 @@ Improvements - LCR Driver now supports instruments reporting as Keysight or Agilent. Newer models of the LCR meter report as Keysight, whereas older models report as Agilent. - Fixed a bug where the PPS would crash if it was polled too frequently. - Changed tolerances for PPS and DMM tests to more accurately match device accuracy. +- Created a new FixateError base class for all exceptions raised by fixate to use. It inherits from Exception instead of BaseExcepetion to improve error handling. ************* Version 0.6.4 diff --git a/src/fixate/core/exceptions.py b/src/fixate/core/exceptions.py index d151e5b..be4a6db 100644 --- a/src/fixate/core/exceptions.py +++ b/src/fixate/core/exceptions.py @@ -1,20 +1,24 @@ -class SequenceAbort(BaseException): +class FixateError(Exception): pass -class ScriptError(BaseException): +class SequenceAbort(FixateError): pass -class TestRetryExceeded(BaseException): +class ScriptError(FixateError): pass -class TestAbort(BaseException): +class TestRetryExceeded(FixateError): pass -class InstrumentError(BaseException): +class TestAbort(FixateError): + pass + + +class InstrumentError(FixateError): pass @@ -22,11 +26,11 @@ class InstrumentTimeOut(InstrumentError): pass -class ParameterError(BaseException): +class ParameterError(FixateError): pass -class InvalidScalarQuantityError(BaseException): +class InvalidScalarQuantityError(FixateError): pass @@ -38,7 +42,7 @@ class InstrumentNotConnected(InstrumentError): pass -class NotCompatible(BaseException): +class NotCompatible(FixateError): pass @@ -46,21 +50,21 @@ class MissingParameters(ParameterError): pass -class UserInputError(BaseException): +class UserInputError(FixateError): pass -class TestClassError(BaseException): +class TestClassError(FixateError): pass -class TestError(BaseException): +class TestError(FixateError): pass -class DUTError(BaseException): +class DUTError(FixateError): pass -class CheckFail(BaseException): +class CheckFail(FixateError): pass diff --git a/src/fixate/drivers/ftdi.py b/src/fixate/drivers/ftdi.py index 3b73764..8aa2ff3 100644 --- a/src/fixate/drivers/ftdi.py +++ b/src/fixate/drivers/ftdi.py @@ -6,7 +6,7 @@ import fixate.drivers from fixate.core.common import bits -from fixate.core.exceptions import InstrumentNotConnected +from fixate.core.exceptions import FixateError, InstrumentNotConnected from fixate.drivers._ftdi import ftdI2xx @@ -44,7 +44,7 @@ } -class FTD2XXError(BaseException): +class FTD2XXError(FixateError): pass