candlepin/candlepin — pull request #729 by dcrissman (2014-10-03 19:00:48+00:00)
Title: Make it possible for CandlepinExceptions to not log stacktraces.

I know this probably seems like an odd change, but we need the ability to disable the CandlepinExceptionMapper from logging at ERROR level and the full stacktrace for certain Exception types, in this case UnauthorizedException. I added a flag to the parent CandlepinException that defaults to the behaviour as it has always been. Obviously, for the vast majority of Exceptions, we would want it logged as an ERROR with the full stacktrace.

When we throw the UnauthorizedException in our own adapter implementation we will disable this flag and take on the responsibility of making sure it is logged appropriately. In our case we would be much happier with a single line WARN that does not include a stacktrace.

I am certainly open to suggestions if you have a better idea for how this could be achieved.