Why different error codes for same Exception?

1

I am doing one synchronization example. I got two exceptions which are having same details about exception. But with the error codes.

And both exceptions have the same Inner Exceptions

What is means? What Error Codes will tell us more than exceptions? How to get the details about my error code. Thanks in Advance

Microsoft.Synchronization.SyncException: A storage engine operation failed with error code 25051 (HRESULT = 0x80004005, Source IID = {0FB15084-AF41-11CE-BD2B-204C4F4F5020}, Parameters=(0, 0, 0, , , , )).

Microsoft.Synchronization.SyncException: A storage engine operation failed with error code 25009 (HRESULT = 0x80004005, Source IID = {0FB15084-AF41-11CE-BD2B-204C4F4F5020}, Parameters=(0, 0, 0, , , , )).
c#
.net
exception-handling
error-code
asked on Stack Overflow Apr 17, 2017 by Prashanth Reddy Balemula • edited Apr 17, 2017 by Prashanth Reddy Balemula

2 Answers

2

From the wording of the message it looks like these are SQL CE errors. If so, have a look here for the meaning of the actual error codes. For .NET code that wraps native code, it is not uncommon that one managed exception, SyncException here, is used with multiple error codes in addition (most prominent example Win32Exception).

From the documentation there seems to be no apparent way to get this numeric code.

However, whether you can really react differently in your code, depending on one error code or the other, is questionable anyway. Log the error with all details and be done with it.

answered on Stack Overflow Apr 17, 2017 by Christian.K • edited Apr 17, 2017 by Christian.K
0

Finally got cleaned after reading the documentation


User contributions licensed under CC BY-SA 3.0