I am writing a C# .NET 2.0 application wherein when a message is expected to be received via the SerialPort
. If the frame is not received (i.e. times out) or it is determined to be invalid, I need to set an error code using SetLastError
. Windows has a plethora of error codes. Is there a simple tool or reference to help narrow down the proper error code to use?
ADDITIONAL INFO
While throwing an exception and handling it higher up the stack is my preference, that is not an option in this case because the application I am updating was not designed to take advantage of such a useful feature.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…