karlwancl / YahooFinanceApi

A handy Yahoo! Finance api wrapper, based on .NET Standard 2.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on History data download

ken88ling opened this issue · comments

It's prompt error if I try to pass invalid ticker of stock

capture1

Please refer this picture.

@ken88ling What you would expect other than 404 (NotFound) when proceeding with invalid ticker ? Is it bad behavior at all ?

@ken88ling, as @delvier has mentioned, we query by substituing the ticker into the url. If we use an invalid ticker, no valid endpoint can be targeted, hence the 404 error. But i agree that the error message is too generic and does not provide useful information to the failure, I have added an exception message especially for the NotFound error, please see if the changes works for you.

@delvier @lppkarl Thank's for your feed back, I don't know why the visual studio is keep warning if I didn't xxx.await(); but after I use the await(), the program will show an error if I give invalid ticker. It's fine if I remove the await().