Skip to content

fix: Potentially uncaught exception in access token request#16

Merged
alannix-lw merged 1 commit into
masterfrom
alannix-lw/response-exception-fix
Mar 22, 2021
Merged

fix: Potentially uncaught exception in access token request#16
alannix-lw merged 1 commit into
masterfrom
alannix-lw/response-exception-fix

Conversation

@alannix-lw

Copy link
Copy Markdown
Contributor

@alannix-lw alannix-lw requested a review from hazedav March 20, 2021 05:06
Comment thread laceworksdk/http_session.py Outdated
if response:
raise ApiError(response)
else:
logger.error("Call to _get_access_token() returned no response.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we raise an exception no matter what? Just raise a fancier Exception (ApiError) if we have a response?

except Exception:
    if response:
        raise ApiError(response)
    raise

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, of course - thank you!

@alannix-lw alannix-lw force-pushed the alannix-lw/response-exception-fix branch from 100d567 to 9ce4309 Compare March 22, 2021 16:58

@hazedav hazedav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alannix-lw alannix-lw merged commit c3a9d1e into master Mar 22, 2021
@alannix-lw alannix-lw deleted the alannix-lw/response-exception-fix branch March 22, 2021 18:32
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 this pull request may close these issues.

2 participants