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

CreateSubscriptionChange - validation error crashes client #698

Open
euang opened this issue Mar 24, 2022 · 1 comment
Open

CreateSubscriptionChange - validation error crashes client #698

euang opened this issue Mar 24, 2022 · 1 comment

Comments

@euang
Copy link

euang commented Mar 24, 2022

I'm calling CreateSubscriptionChange in 4.18 with a coupon that has already been redeemed on that subscription.

The api is returning this JSON which then fails to get parsed and throws this exception.

Newtonsoft.Json.JsonReaderException HResult=0x80131500 Message=Unexpected character encountered while parsing value: [. Path 'error.params[0].message', line 1, position 149. Source=Newtonsoft.Json StackTrace: at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType) in /_/Src/Newtonsoft.Json/JsonTextReader.cs:line 671

JSON
{"error":{"type":"validation","message":"Coupon code [\"has reached max redemptions for this account\"]","params":[{"param":"coupon_code","message":["has reached max redemptions for this account"]}]}}

StackTrace
Newtonsoft.Json.dll!Newtonsoft.Json.JsonSerializer.Deserialize<Recurly.Errors.ApiErrorWrapper>(Newtonsoft.Json.JsonReader reader) Line 870
at /_/Src/Newtonsoft.Json/JsonSerializer.cs(870)
Recurly.dll!Recurly.JsonSerializer.Deserialize<Recurly.Errors.ApiErrorWrapper>(RestSharp.IRestResponse response) Line 72
at Recurly\JsonSerializer.cs(72)
Recurly.dll!Recurly.BaseClient.HandleResponse(RestSharp.IRestResponse resp) Line 269
at Recurly\BaseClient.cs(269)
Recurly.dll!Recurly.BaseClient.MakeRequest<Recurly.Resources.SubscriptionChange>(RestSharp.Method method, string url, Recurly.Request body, System.Collections.Generic.Dictionary<string, object> queryParams, Recurly.RequestOptions options) Line 169
at Recurly\BaseClient.cs(169)
Recurly.dll!Recurly.Client.CreateSubscriptionChange(string subscriptionId, Recurly.Resources.SubscriptionChangeCreate body, Recurly.RequestOptions options) Line 1813
at Recurly\Client.cs(1813)

@nls-aarndt
Copy link

Hello, are there any plans to fix this? We continue to encounter this issue in SDK version 4.50.0

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

2 participants