-
Notifications
You must be signed in to change notification settings - Fork 134
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
prevent exceptions from being passed into Args #2140
Conversation
Generate changelog in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally lgtm, just a couple suggestions!
baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/LogsafeArgument.java
Outdated
Show resolved
Hide resolved
baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/LogsafeArgument.java
Outdated
Show resolved
Hide resolved
return buildDescription(tree) | ||
.setMessage("Args with type Throwable are not allowed.") | ||
.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When there's a single failure message, we can set it in the top-level @BugPattern
annotation summary
field, then we can return describeMatch(tree);
on failure.
...eline-java/src/main/groovy/com/palantir/baseline/extensions/BaselineErrorProneExtension.java
Outdated
Show resolved
Hide resolved
|
||
@AutoService(BugChecker.class) | ||
@BugPattern( | ||
name = "LogsafeArgument", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I think we'll need to rebase and remove this line (due to the error_prone 2.11 upgrade)
name = "LogsafeArgument", |
baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/LogsafeArgument.java
Outdated
Show resolved
Hide resolved
baseline-error-prone/src/test/java/com/palantir/baseline/errorprone/LogsafeArgumentTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Carter Kozak <ckozak@ckozak.net>
Released 4.99.0 |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.99.0 | Type | Description | Link | | ---- | ----------- | ---- | | Feature | prevent exceptions from being passed into Args | palantir/gradle-baseline#2140 | To enable or disable this check, please contact the maintainers of Excavator.
Before this PR
Exceptions can be passed into SafeArg/UnsafeArg, which loses the stacktrace.
After this PR
==COMMIT_MSG==
prevent exceptions from being passed into Args
==COMMIT_MSG==
Possible downsides?
None.