-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.11.0
-
Component/s: Error Handling
-
None
The NativeMethods.CreateException method maps a known errorCode to a corresponding string, but if the errorCode is not one we know about we use the defaultMessage.
When the defaultMessage is used this way some information is lost because we don't know what the errorCode was.
We should append the error code to the default message, something like:
message = defaultMessage + $" Error code {errorCode}.";