From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Data Acquisition Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
CurtisHx

Add type-specific exceptions in .NET DAQmx

Status: New

From what I can tell, there is one master DaqException that is used for everything that goes wrong.  This makes checking for certain exceptions extremely difficult, as you are now limited to checking the error message for certain strings.  This is fragile.

 

Please provide typed exceptions in the .NET DAQmx library.  For example, if a task times out, it should throw a "TaskTimeoutException", which might be a child of DaqException.  Or if the timing setup is invalid, the library would throw a "InvalidTimingConfigurationException".

 

Yes, I realize it's a bit of busy work to create a bunch of typed exceptions, but it makes error handling for consumers much easier.