Skip to content

Fails to parse error response #134

@yuri-tceretian

Description

@yuri-tceretian

When I run the library against sandbox API that seemed to be down at that time I got a response that was not expected by the response handler.

SignNow.Net.Exceptions.SignNowException : Newtonsoft.Json.JsonReaderException thrown while parsing Json body from https://api-eval.signnow.com/oauth2/token (Invalid Json syntax in response (Unexpected character encountered while parsing value: [. Path 'error', line 1, position 10.))
Data:
  RawHeaders: System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.IEnumerable`1[System.String]]
  RawResponse: {"error":[{"code":"HY000","message":"Internal Api Error"}]}
  HttpStatusCode: 500
  ----> SignNow.Net.Exceptions.SignNowException : Invalid Json syntax in response (Unexpected character encountered while parsing value: [. Path 'error', line 1, position 10.)
  ----> Newtonsoft.Json.JsonReaderException : Unexpected character encountered while parsing value: [. Path 'error', line 1, position 10.
   at SignNow.Net.Internal.Service.SignNowClient.ProcessErrorResponse(RequestOptions requestOptions, HttpResponseMessage response)
   at SignNow.Net.Internal.Service.SignNowClient.RequestAsync[TResponse](RequestOptions requestOptions, IHttpContentAdapter`1 adapter, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at SignNow.Net.Internal.Service.SignNowClient.RequestAsync[TResponse](RequestOptions requestOptions, CancellationToken cancellationToken)
   at SignNow.Net.OAuth2Service.ExecuteTokenRequest(Dictionary`2 body, CancellationToken cancellationToken)
   at SignNow.Net.OAuth2Service.GetTokenAsync(String login, String password, Scope scope, CancellationToken cancellationToken)
--SignNowException

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions