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

Maybe create a new Exception class for get_request_result errors? #106

Open
presto8 opened this issue Feb 18, 2025 · 0 comments
Open

Maybe create a new Exception class for get_request_result errors? #106

presto8 opened this issue Feb 18, 2025 · 0 comments

Comments

@presto8
Copy link

presto8 commented Feb 18, 2025

https://github.com/jessecooper/pyetrade/blob/adff0ee58aa273693d097ac7aea14756e6a55563/pyetrade/order.py#L50C15-L50C24

The use of a bare Exception makes it difficult to catch this at a higher layer, because the higher layer would have to catch all Exceptions, not just this one.

Also there is no way for the higher layer to access the fields of the error object as they are not propagated.

What would you think of creating something like an EtradeRequestException() that passes back req_output?

Thanks!

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