Create CrawlerConfigurationException Specialization. Avoid throw Exception.#149
Create CrawlerConfigurationException Specialization. Avoid throw Exception.#149gustavofoa wants to merge 1 commit intoyasserg:masterfrom gustavofoa:master
Conversation
|
Thank you Gustav. Yasser, this pull request looks good and can be merged |
|
This makes sense to me... if we go for the next release version, this will be a benefit to pass the automated reviews... Maybe @s17t can look at this... |
|
I made a similar pull request after you, did't saw this. Anyway, I think there's much more with exception declaration to be done. CrawlController constructor, for instance, claims to throw a bare exception, but there are like 5 checked exceptions and 10-15 unchecked thrown by instructions inside. Should he wrap them in an unchecked common exception? Maybe a ControllerInstantiationException? That would require more CPU to capture and filter causes. Exceptions, error codes and so on have allways been a matter of discussion. The problem with catching a bare Exception is that you'll get runtimes and every other exception. Some times, by catching runtime before exception youn avoid style warnings, it depends on the checks performed. Anyway, keep in mind that introducing new exceptions to substitute plain Exceptions may cause copde using this lkibrary to wrongly identify the errors ocured. Most people will leave it for a major version change: People are alñready catching Exceptions, so the coded will not show any errors due to new exceptions not being caught. |
I had to fix a sonar constraint ("Avoid catch Exception") in my project because the CrawerController constructor throws a pure Exception.
I hope that this contribution is useful.