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

Response Exception error #10

Open
ocman-nazir-briet opened this issue Aug 1, 2023 · 0 comments
Open

Response Exception error #10

ocman-nazir-briet opened this issue Aug 1, 2023 · 0 comments

Comments

@ocman-nazir-briet
Copy link

ocman-nazir-briet commented Aug 1, 2023

ISSUE:

try:
        response = auth_client.get_user_info()
    except ValueError:
        return HttpResponse('id_token or access_token not found.')
    except AuthClientError as e:
        print(e.status_code)
        print(e.intuit_tid)
    return HttpResponse(response.content)

Below is the fixed code for issue

_# if there is no response then it throws an error so we need to put a check here so that if there is no response we can return message_
try:
        response = auth_client.get_user_info()
    except ValueError:
        return HttpResponse('id_token or access_token not found.')
    except AuthClientError as e:
        print(e.status_code)
        print(e.intuit_tid)
    if response:
        return HttpResponse(response.content)
    else:
        return HttpResponse('Something Went Wrong!')
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