Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

How can I properly trap raise_for_status() #11

Open
JulienMaille opened this issue Jun 2, 2018 · 0 comments
Open

How can I properly trap raise_for_status() #11

JulienMaille opened this issue Jun 2, 2018 · 0 comments

Comments

@JulienMaille
Copy link

Right now I have to comment that line, otherwise the script will stop very often, how can I properly trap this, validate_response is called in many places

response.raise_for_status()

def validate_response(session, response, auth=False):
    try:
        try:
            js_response = json.loads(response.text)
        except:
            #response.raise_for_status()
            if auth:
                raise AuthFailed('Authentication failed')
        else:
            if auth:
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant