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

Expose HTTP code for non-400 errors #123

Open
yuzeh opened this issue Aug 31, 2015 · 0 comments
Open

Expose HTTP code for non-400 errors #123

yuzeh opened this issue Aug 31, 2015 · 0 comments

Comments

@yuzeh
Copy link

yuzeh commented Aug 31, 2015

I've been using ParsePy and have seen stacktraces of the following form recently:

(rest of stack elided)
  File "/usr/local/lib/python2.7/dist-packages/parse_rest/query.py", line 37, in _fetch
    return [klass(**it) for it in klass.GET(uri, **kw).get('results')]
  File "/usr/local/lib/python2.7/dist-packages/parse_rest/connection.py", line 107, in GET
    return cls.execute(uri, 'GET', **kw)
  File "/usr/local/lib/python2.7/dist-packages/parse_rest/connection.py", line 101, in execute
    raise exc(e.read())
parse_rest.core.ParseError

Looks like the last entry comes from here:

https://github.com/dgrtwo/ParsePy/blob/9c5bd490e14f89e1b13d3b39b4dada3a7400e6c4/parse_rest/connection.py#L126

From my understanding, this means that the Parse server returned an error that isn't 400, 401, 403, or 404, with no message.

Since Parse isn't returning a message, I'm left in the dark about what kind of error this is, which is problematic for figuring out what to do. E.g it's a 5xx, I'd want to retry, but bubble up the exception if it's a 4xx.

If adding this information to ParseError makes sense, I'm happy to send over a pull request.

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