File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
errors/src/main/java/com/palantir/conjure/java/api/errors Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1+ type : improvement
2+ improvement :
3+ description : Ensure QosReason cannot be provided as `null` by throwing an exception
4+ immediately
5+ links :
6+ - https://github.com/palantir/conjure-java-runtime-api/pull/929
Original file line number Diff line number Diff line change 1717package com .palantir .conjure .java .api .errors ;
1818
1919import com .palantir .logsafe .Arg ;
20+ import com .palantir .logsafe .Preconditions ;
2021import com .palantir .logsafe .SafeArg ;
2122import com .palantir .logsafe .SafeLoggable ;
2223import com .palantir .logsafe .UnsafeArg ;
@@ -39,12 +40,12 @@ public abstract class QosException extends RuntimeException {
3940 // Not meant for external subclassing.
4041 private QosException (String message , QosReason reason ) {
4142 super (message );
42- this .reason = reason ;
43+ this .reason = Preconditions . checkNotNull ( reason , "QosReason is required" ) ;
4344 }
4445
4546 private QosException (String message , Throwable cause , QosReason reason ) {
4647 super (message , cause );
47- this .reason = reason ;
48+ this .reason = Preconditions . checkNotNull ( reason , "QosReason is required" ) ;
4849 }
4950
5051 public final QosReason getReason () {
You can’t perform that action at this time.
0 commit comments