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

Please add errors field to MailchimpException from response body. #22

Open
saaadel opened this issue Nov 23, 2017 · 0 comments
Open

Please add errors field to MailchimpException from response body. #22

saaadel opened this issue Nov 23, 2017 · 0 comments

Comments

@saaadel
Copy link

saaadel commented Nov 23, 2017

Look at those lines:

if (response.responseBody != null) {
try {
val error = JsonParser().parse(response.responseBody).asJsonObject
code = error.get("status").asInt
description = error.get("detail").asString
} catch (e: Exception){}
}
throw MailchimpException(code, description)

Sometime we have "errors" field in the response body here, when we have problems with fields filled in the request (for example, required fields are not set, or set with invalid values).

Could you add this "errors" fields as List<Map<String,Object>> onto MailchimpException object with public getter for this unmodifiable list? This field is optional in the response body (can be NULL for MailchimpException)

Or, should I create PR for it by myself?

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