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

feat(tx): implements token handler #14

Merged
merged 2 commits into from
Jun 9, 2021
Merged

feat(tx): implements token handler #14

merged 2 commits into from
Jun 9, 2021

Conversation

justgigio
Copy link
Contributor

No description provided.

@justgigio justgigio requested a review from a team June 8, 2021 13:13
@justgigio justgigio self-assigned this Jun 8, 2021
raise Exception('not_found')

return {
"statusCode": 200,
Copy link
Member

Choose a reason for hiding this comment

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

In case response.status_code (or .status, or whatever else it's called) is not 200, what do we do? Shouldn't we just forward the response status code or at least error when it isn't 200?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The exception above will lead to a 404

Copy link
Member

Choose a reason for hiding this comment

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

Is it possible that response != None and still response.status_code != 200, couldn't an error (404/500/...) on get_token.get have some response that is not None?

Either way I think we should try to improve this in the future, using a wrapper is great, but using bare Exceptions isn't that great, I think specific exception classes are much better. Or we could also use something like aiohttp that has a good set of handy features like those exceptions classes.

@justgigio justgigio merged commit 12353ef into dev Jun 9, 2021
@justgigio justgigio linked an issue Jun 9, 2021 that may be closed by this pull request
@justgigio justgigio mentioned this pull request Jun 16, 2021
17 tasks
@justgigio justgigio deleted the feat/token-handlers branch July 1, 2021 17:30
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.

[HEV1] Token Info Handler
3 participants