From 540a3432944d60d59ca02dc5ac845527736957b4 Mon Sep 17 00:00:00 2001 From: Riley King Date: Fri, 5 Sep 2025 13:22:18 +1000 Subject: [PATCH 1/5] Changed FTD2XXError to use `Exception` as a base rather than `BaseException`. No script catches it meaning that if the FTDI driver raises an exception while a power supply is live, it will not be turned off. --- src/fixate/drivers/ftdi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fixate/drivers/ftdi.py b/src/fixate/drivers/ftdi.py index 3b737641..dd136101 100644 --- a/src/fixate/drivers/ftdi.py +++ b/src/fixate/drivers/ftdi.py @@ -44,7 +44,7 @@ } -class FTD2XXError(BaseException): +class FTD2XXError(Exception): pass From 948f4d51dcf95ceab9c6ab362bd6dc504adc05c4 Mon Sep 17 00:00:00 2001 From: Riley King Date: Fri, 5 Sep 2025 13:23:38 +1000 Subject: [PATCH 2/5] This is an optional continuance from 540a3432944d60d59ca02dc5ac845527736957b4 that replaces *ALL* occurances of BaseException with Exception. Realistically there is no reason to be using BaseException over Exception unless you want to kill the program. --- src/fixate/core/exceptions.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/fixate/core/exceptions.py b/src/fixate/core/exceptions.py index d151e5bd..7288bd02 100644 --- a/src/fixate/core/exceptions.py +++ b/src/fixate/core/exceptions.py @@ -1,20 +1,20 @@ -class SequenceAbort(BaseException): +class SequenceAbort(Exception): pass -class ScriptError(BaseException): +class ScriptError(Exception): pass -class TestRetryExceeded(BaseException): +class TestRetryExceeded(Exception): pass -class TestAbort(BaseException): +class TestAbort(Exception): pass -class InstrumentError(BaseException): +class InstrumentError(Exception): pass @@ -22,11 +22,11 @@ class InstrumentTimeOut(InstrumentError): pass -class ParameterError(BaseException): +class ParameterError(Exception): pass -class InvalidScalarQuantityError(BaseException): +class InvalidScalarQuantityError(Exception): pass @@ -38,7 +38,7 @@ class InstrumentNotConnected(InstrumentError): pass -class NotCompatible(BaseException): +class NotCompatible(Exception): pass @@ -46,21 +46,21 @@ class MissingParameters(ParameterError): pass -class UserInputError(BaseException): +class UserInputError(Exception): pass -class TestClassError(BaseException): +class TestClassError(Exception): pass -class TestError(BaseException): +class TestError(Exception): pass -class DUTError(BaseException): +class DUTError(Exception): pass -class CheckFail(BaseException): +class CheckFail(Exception): pass From 8bd2cebbf1d4331f95ac621e93f8d8d5db7b9ab8 Mon Sep 17 00:00:00 2001 From: Overlord360 <49475695+Overlord360@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:03:49 +1100 Subject: [PATCH 3/5] Add top level FixateError that other exceptions inherit from --- src/fixate/core/exceptions.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/fixate/core/exceptions.py b/src/fixate/core/exceptions.py index 7288bd02..be4a6dbd 100644 --- a/src/fixate/core/exceptions.py +++ b/src/fixate/core/exceptions.py @@ -1,20 +1,24 @@ -class SequenceAbort(Exception): +class FixateError(Exception): pass -class ScriptError(Exception): +class SequenceAbort(FixateError): pass -class TestRetryExceeded(Exception): +class ScriptError(FixateError): pass -class TestAbort(Exception): +class TestRetryExceeded(FixateError): pass -class InstrumentError(Exception): +class TestAbort(FixateError): + pass + + +class InstrumentError(FixateError): pass @@ -22,11 +26,11 @@ class InstrumentTimeOut(InstrumentError): pass -class ParameterError(Exception): +class ParameterError(FixateError): pass -class InvalidScalarQuantityError(Exception): +class InvalidScalarQuantityError(FixateError): pass @@ -38,7 +42,7 @@ class InstrumentNotConnected(InstrumentError): pass -class NotCompatible(Exception): +class NotCompatible(FixateError): pass @@ -46,21 +50,21 @@ class MissingParameters(ParameterError): pass -class UserInputError(Exception): +class UserInputError(FixateError): pass -class TestClassError(Exception): +class TestClassError(FixateError): pass -class TestError(Exception): +class TestError(FixateError): pass -class DUTError(Exception): +class DUTError(FixateError): pass -class CheckFail(Exception): +class CheckFail(FixateError): pass From d07583d31f713d33d60f47713bd0da3cef3bd72d Mon Sep 17 00:00:00 2001 From: Overlord360 <49475695+Overlord360@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:07:39 +1100 Subject: [PATCH 4/5] change FTDI exception to inherit from FixateError --- src/fixate/drivers/ftdi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fixate/drivers/ftdi.py b/src/fixate/drivers/ftdi.py index dd136101..8aa2ff3f 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(Exception): +class FTD2XXError(FixateError): pass From d5ac7e016b4144832189fe5a0a6ed1f845f1c118 Mon Sep 17 00:00:00 2001 From: Overlord360 <49475695+Overlord360@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:32:11 +1100 Subject: [PATCH 5/5] Update release notes --- docs/release-notes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes.rst b/docs/release-notes.rst index f05ffe08..5c1da9b8 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