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

Error parsing API error response #91

Open
linuxdaemon opened this issue Mar 30, 2016 · 2 comments · May be fixed by #129
Open

Error parsing API error response #91

linuxdaemon opened this issue Mar 30, 2016 · 2 comments · May be fixed by #129

Comments

@linuxdaemon
Copy link

When the API itself returns an error, in my case, it was that the queue limit had been reached, the JumblrException class attempts to cast response.errors to a JsonArray, when it is in fact a JsonObject. Tested by building a custom version of Jumblr and adding a print line just before the cast. the response received is '{"errors":{"state":"Can't queue more than 300 posts."}}' and the relevant line is JumblrException.java:83

@Linus12
Copy link

Linus12 commented Sep 1, 2016

This has caused me numerous problems in debugging errors that are not specific to the API or my code. I now have a switch in place to print the actual error as above that I have to use when I get these problems.

@ndtreviv
Copy link

ndtreviv commented May 1, 2019

I'm finding also object arrays, eg:

{
    "meta": {
        "status": 404,
        "msg": "Not Found"
    },
    "response": [],
    "errors": [
        {
            "title": "Not Found",
            "code": 4012,
            "detail": "This Tumblr is only viewable within the Tumblr dashboard"
        }
    ]
}

In my case, I'd like to be able to distinguish between blogs that no longer exist, or ones that do exist, but are only available on the Tumblr dashboard, so switching on the error code isn't going to help.

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

Successfully merging a pull request may close this issue.

3 participants