Reader.ParseArticle will raise weird HttpRequestException exception
For this code:
Article article = Reader.ParseArticle(url);
If request to the url returned HTTP 403 Forbidden, it will raise HttpRequestException exception. The exception object will contains a .StatusCude property but the value will be (null), and the .Message property will contains Cannot GET resource <URL>. StatusCode: Forbidden. That's not what I expected.
Thanks for reporting the issue. I will work on fixing it this weekend.
There is an old issue related to this Exception: Raise a clear exception on non-successful http status code and document it. They wanted to have a custom SmartReader-based exception or document the current exception the library raises. We now document the exception.
However, maybe we should change the way we handle fail cases, given that a few people are surprised by our current approach. For instance, we could catch all exceptions and add some message to Article to indicate a failure in retrieving the article. What do you suggest? What would you want to happen instead of throwing an exception?