-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance logging in ConsulFailoverInterceptor (#309)
* If debug level is enabled, log the exception (and stack trace) at debug level. Otherwise, log the exception at warning level including the exception type, but not the stack trace. Include a message that the stack trace can be seen by enabling debug level for the Logger. * Internal refactoring to remove the duplicate calls to get() the value from the Optional<Request>. When inside the loop, we know that the Optional contains a value, so it's annoying to see repetitive calls to nextRequest.get(). * Rename the nextRequest Optional to maybeNextRequest to make it more obvious that it isn't a real Request. * Replace JetBrains NotNull annotation with Checker's NonNull. The reason is that the JetBrains annotations come in transitively whereas Checker is a direct dependency. While this is not huge deal, we also have (more or less) standardized on using the Checker annotations for nullability. * Change the Optional#get call to orElseThrow. The reason is that, since the while loop's Optional#isPresent test was true, the Optional#get call must succeed inside the loop body. Otherwise, something else (i.e., a coding error) is wrong. Closes #305
- Loading branch information
1 parent
983668f
commit 262b41d
Showing
2 changed files
with
75 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters