New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Check: EitherLogOrThrowCheck #82

Closed
romani opened this Issue Nov 8, 2012 · 0 comments

Comments

Projects
None yet
2 participants
@romani
Member

romani commented Nov 8, 2012

There is anti-pattern - http://today.java.net/article/2006/04/04/exception-handling-antipatterns#logAndThrow

so we need to detect logging and re-throwing exception:

catch (NoSuchMethodException e) {
  LOG.error("Blah", e);
  throw e;
}

but we need to have an option to ignore cases that do logging but without exception information, so it possible that before throw we would like to print a lot of useful internal information for investigation

catch (NoSuchMethodException e) {
  LOG.error("Some information that is known only at this scope", someField);
  throw e;
}

@ghost ghost assigned baratali Aug 2, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Aug 15, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Aug 15, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Aug 27, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Aug 27, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Aug 29, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Aug 29, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Aug 30, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Sep 8, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Sep 10, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Sep 10, 2013

baratali added a commit to baratali/sevntu.checkstyle that referenced this issue Sep 13, 2013

@romani romani closed this in #133 Sep 17, 2013

romani added a commit that referenced this issue Sep 17, 2013

Merge pull request #133 from baratali/iss82
Fixes #82. EitherLogOrThrowCheck was introduced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment