SonarQube Throw Exceptions correctly