Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception when calling PlaidClient.FetchTransactionsAsync #50

Open
derekantrican opened this issue May 4, 2021 · 0 comments

Comments

@derekantrican
Copy link
Contributor

I have the following code:

GetTransactionsResponse transactions = await plaidClient.FetchTransactionsAsync(new GetTransactionsRequest
{
    ClientId = plaidClientId,
    Secret = plaidSecret,
    AccessToken = sources[source],
    StartDate = beginningOfMonth,
    EndDate = beginningOfNextMonth,
});

I call this code in a loop and during one iteration I got the following unhandled exception:

Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
   at Acklann.Plaid.PlaidClient.CreateResponse[TResponse](HttpResponseMessage response)
   at Acklann.Plaid.PlaidClient.PostAsync[TResponse](String path, SerializableContent request)
   at TransactionChecker.Program.CheckForNewTransactionsAsync(Boolean firstRun) in C:\Users\derek\source\repos\TransactionChecker\TransactionChecker\Program.cs:line 85

Could this be wrapped up into a PlaidException and return GetTransactionsResponse.IsSuccessStatusCode = false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant