Closed Major-Mike closed 3 months ago
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 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.
When using the SDK call:
envelopesApi.ListStatusChanges(..)
there is no access to theerrorDetails
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?