You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most MySqlException objects have a corresponding MySqlErrorCode. This is exposed through the public int Number { get; } property, which requires a (non-obvious) cast.
Since this isn't useful, and is already accessible through Exception.HResult, define public new MySqlErrorCode ErrorCode { get; } and return the error code that way.
Most
MySqlException
objects have a correspondingMySqlErrorCode
. This is exposed through thepublic int Number { get; }
property, which requires a (non-obvious) cast.There's a
virtual int ErrorCode { get; }
property inherited fromExternalException
, which appears to always returnE_FAIL
: https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ExternalException.csSince this isn't useful, and is already accessible through
Exception.HResult
, definepublic new MySqlErrorCode ErrorCode { get; }
and return the error code that way.(Connector/NET adds a confusingly-named
Code
property that's only defined for the X Protocol: https://stackoverflow.com/a/60293352/23633.)The text was updated successfully, but these errors were encountered: