mgolokhov / dodroid

May the knowledge be with you!
MIT License
20 stars 12 forks source link

squid:S00112 - Generic exceptions should never be thrown #91

Closed georgekankava closed 8 years ago

georgekankava commented 8 years ago

This pull request is focused on resolving occurrences of Sonar rule squid:S00112 - Generic exceptions should never be thrown. This pull request removes 40 minutes of technical debt. You can find more information about the issue here: https://dev.eclipse.org/sonar/rules/show/squid:S00112 Please let me know if you have any questions. George Kankava

mgolokhov commented 8 years ago

Thank you for pointing a smelly code. For sure it should be refactored.

Introducing a new class does not give any useful information to the client code, other than an indicative exception name.

First we have to answer question. What action can the client code take when the exception occurs? We are referring to read only internal resource, if exception happens user cannot do anything. Possible options:

georgekankava commented 8 years ago

@mgolokhov I will update it tomorrow. Thanks

georgekankava commented 8 years ago

@mgolokhov PR Updated. As you mentioned I just removed throwing exception and left logging.

mgolokhov commented 8 years ago

Merged and squashed with refactored version as one commit. Thank you.