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

[historical] throw error if given a string for period{1,2} that is invalid input for new Date() #457

Closed
gadicc opened this issue Apr 27, 2022 · 1 comment · Fixed by #460
Labels
enhancement New feature or request released

Comments

@gadicc
Copy link
Owner

gadicc commented Apr 27, 2022

$ yahoo-finance historical TSLA '{"period1":"2022-02-01","period2":"today"}'
https://query2.finance.yahoo.com/v7/finance/download/TSLA?interval=1d&events=history&includeAdjustedClose=true&period1=1643673600&period2=NaN
Exiting with HTTPError: Bad Request

We should validate period1 and period2 and throw an error on invalid input before trying to make the request.

As reported by @kiloppertry in #429.

@gadicc gadicc added the enhancement New feature or request label Apr 27, 2022
@gadicc gadicc changed the title [historical] throw error on invalid options; specifically: validate period1/2 [historical] throw error if given a string for period{1,2} that is invalid input for new Date() Apr 27, 2022
gadicc pushed a commit that referenced this issue May 1, 2022
… new Date() (#460)

Closes #457.

* [docs] small typo
* [historical] throw error if given a string for period{1,2} that is invalid input for new Date()
@gadicc
Copy link
Owner Author

gadicc commented May 2, 2022

🎉 This issue has been resolved in version 2.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gadicc gadicc added the released label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
1 participant