04-29-2016 09:51 AM
This exception message is useless.
Ivi.Driver.OutOfRangeException: ModularInstruments.NIDmm: The specified argument was out of the range of valid values.
All of the information is provided with "Ivi.Driver.OutOfRangeException" exception type. The message adds nothing else of value. I can clearly see the specified argument was out of the range of valid values. I would really like to know which argument was out of range, the value of argument, and the valid values for that argument.
These useless messages are not limited to the .NET IVI API. It's across all .NET libraries, and they are infuriating. I don't think I can express just how much the rage monster wants out of his cage right now.
Either leave the message off entirely, or (even better) provide USEFUL information in the message. This
Ivi.Driver.OutOfRangeException: ModularInstruments.NIDmm: Parameter "Resolution" of 1234 is out of range.
"Resolution" is expected to be between 1 and 1000.
tells me
1) What went wrong (Parameter Resolution was out of range)
2) Why it went wrong (Resolution needs to be in between 1 and 1000)
3) What to do to fix the problem (Make sure Resolution is between 1 and 1000)
05-02-2016 02:15 PM
Hi CurtisHx,
I apologize for the frustration and inconvenience and thank you for the feedback!
I will be sure to convey your feedback and frustration to our .NET and IVI R&D teams.
05-05-2016 09:42 AM
Found an exception message in the NI-DMM library that's a shining example of what a good message should convey:
Error: Ivi.Driver.IviCDriverException: ModularInstruments.NIDCPower: Invalid value for parameter or property. Property: Auto Zero Requested Value: Once Possible Values: Off Status Code: -200077 Error code: -1074135024.
Tells me exactly what property was wrong, the value that cause the exception, and the possible values.