docusign-esign-csharp-client icon indicating copy to clipboard operation
docusign-esign-csharp-client copied to clipboard

SDK provides no access to the errorDetails object

Open Major-Mike opened this issue 4 years ago • 2 comments

When using the SDK call: envelopesApi.ListStatusChanges(..) there is no access to the errorDetails object per API reference schema to check before returning or acting on the response.

Additionally being wrapped in the API object, there is no way I can see to check the status code for 200/400 either, so how do we handle error check then? What am I missing here?

Major-Mike avatar Mar 30 '21 19:03 Major-Mike

Hi Mike,

Sorry to hear you ran into this issue. What you're describing is a bug in our SDK where the response headers are not being properly handled on their way back from DocuSign. The internal reference code for the ticket is DCM-4714.

The good news is that if you're looking for error codes you can still get to the error codes. Running the C# SDK version 5.2 in Visual Studio Professional 2019, I was able to retrieve them using a try/catch with an APIException.

try
            {
               EnvelopeSummary response = envClient.CreateEnvelope(AccountId, envDef);
                Console.WriteLine("Response : " + response.EnvelopeId);
            }
            catch (ApiException e)
            {

                Console.Write("Exception : " + e.ErrorCode + Environment.NewLine + "Error Message: " + e.Message);
            }

            Console.ReadLine();

Output: Exception : 401 Error Message: Error calling CreateEnvelope: {"errorCode":"USER_AUTHENTICATION_FAILED","message":"One or both of Username and Password are invalid."}

Regards, Matt DocuSign Developer Support

MattKingDS avatar Apr 01 '21 15:04 MattKingDS

@MattKingDS Ok, understood. Hopefully they will add that in the future. In the meantime yes I was aware of the crash and catch, which is what I resorted to in the meantime. Glad we are on the same page on that part, saves me asking for thoughts on a workaround 😃 Thanks.

Major-Mike avatar Apr 02 '21 03:04 Major-Mike