-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add more specific error throwing based on PR 1918 #1928
Conversation
- renamed test files conform with standards - replaced utcfromtimestamp
Typo: |
I'm sorry, I still can't see the typo, could you be more specific? |
At line 25 of yfinance/exceptions.py. the new code says
self.ticker = rationale
but surely that should be
self.ticker = ticker
because line 24 is
self.rationale = rationale
Sorry I was not more explicit.
|
Good catch! Thank you very much. |
FYI @elibroftw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final point: can you git-squash some commits to shorten history, at least your last few commits? Helps this https://github.com/ranaroussi/yfinance/network
Sure. I'm squashing only mine to not loose the author on the previous commits. |
Line 25 of exceptions.py is still wrong: |
yfinance/yfinance/exceptions.py Line 25 in 0493373
Looks fine to me |
You are correct. I was apparently looking at the wrong version. Please excuse the spam. |
Closes #270 and #1925
Purpose
It is useful to have the lib to throw specific errors for each failure, instead of the generic
Exception
.With the error types being thrown, clients can chose to handle each failure scenario in different ways.
Ex:
Backwards compatility
Because currently the exception being raise is the type
Exception
, we can safely assume no one is rescuing any of those new types. If any one is rescuingException
code will continue to work in the same way.Notes
This PR is basically the same as #1918 except I rebased to current
dev
and implemented changes suggested on the original PR.I also tested it with my client app and it works as expected.