From 713e3224488e9310e56f3b763f11752755e673dd Mon Sep 17 00:00:00 2001 From: SutterBruce Date: Tue, 27 May 2025 15:50:54 -0700 Subject: [PATCH] Proposal for DeviceInstance::MakeExceptionForCode( ) Propose passing exception code to CMMError constructor, overriding default code. --- MMCore/Devices/DeviceInstance.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MMCore/Devices/DeviceInstance.cpp b/MMCore/Devices/DeviceInstance.cpp index a36ea75b7..6f9e0848e 100644 --- a/MMCore/Devices/DeviceInstance.cpp +++ b/MMCore/Devices/DeviceInstance.cpp @@ -84,8 +84,9 @@ DeviceInstance::MakeException() const CMMError DeviceInstance::MakeExceptionForCode(int code) const { - return CMMError("Error in device " + ToQuotedString(GetLabel()) + ": " + - GetErrorText(code) + " (" + ToString(code) + ")"); + // 2025.05.20.bp: Propose passing exception code as 2nd parameter to constructor, overriding default. + return CMMError("Error in device " + ToQuotedString(GetLabel()) + ": " + + GetErrorText(code) + " (" + ToString(code) + ")", (CMMError::Code)code); } void