Skip to content

Commit 9c642df

Browse files
author
Henry Harris
committed
check
1 parent 76a0e04 commit 9c642df

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

errors/src/main/java/com/palantir/conjure/java/api/errors/BaseServiceException.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222

2323
public abstract class BaseServiceException extends RuntimeException {
2424

25-
protected final ErrorType errorType;
25+
private final ErrorType errorType;
2626

27-
protected final List<Arg<?>> args; // unmodifiable
27+
private final List<Arg<?>> args; // unmodifiable
2828

29-
protected final String errorInstanceId;
29+
private final String errorInstanceId;
3030

31-
protected final String unsafeMessage;
32-
protected final String noArgsMessage;
31+
private final String unsafeMessage;
32+
private final String noArgsMessage;
3333

3434
/**
3535
* Creates a new exception for the given error. All {@link com.palantir.logsafe.Arg parameters} are propagated to
@@ -64,29 +64,29 @@ public abstract class BaseServiceException extends RuntimeException {
6464
/**
6565
* The {@link ErrorType} that gave rise to this exception.
6666
*/
67-
public ErrorType getErrorType() {
67+
public final ErrorType getErrorType() {
6868
return errorType;
6969
}
7070

7171
/**
7272
* A unique identifier for (this instance of) this error.
7373
*/
74-
public String getErrorInstanceId() {
74+
public final String getErrorInstanceId() {
7575
return errorInstanceId;
7676
}
7777

7878
@Override
79-
public String getMessage() {
79+
public final String getMessage() {
8080
// Including all args here since any logger not configured with safe-logging will log this message.
8181
return unsafeMessage;
8282
}
8383

84-
public String getLogMessage() {
84+
public final String getLogMessage() {
8585
// Not returning safe args here since the safe-logging framework will log this message + args explicitly.
8686
return noArgsMessage;
8787
}
8888

89-
public List<Arg<?>> getArgs() {
89+
public final List<Arg<?>> getArgs() {
9090
return args;
9191
}
9292
}

errors/src/main/java/com/palantir/conjure/java/api/errors/EndpointServiceException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This is identical to ServiceException, but is used in Conjure-generated code to indicate that an exception was thrown
2525
* from a service endpoint.
2626
*/
27-
public class EndpointServiceException extends BaseServiceException implements SafeLoggable {
27+
public final class EndpointServiceException extends BaseServiceException implements SafeLoggable {
2828

2929
private static final String EXCEPTION_NAME = "EndpointServiceException";
3030

errors/src/main/java/com/palantir/conjure/java/api/errors/SerializableError.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public abstract class SerializableError implements Serializable {
5050
/**
5151
* A fixed code word identifying the type of error. For errors generated from {@link ServiceException}, this
5252
* corresponds to the {@link ErrorType#code} and is part of the service's API surface. Clients are given access to
53-
* the server-side error code via {@link RemoteException#getError} and typically switch&dispatch on the error code
54-
* and/or name.
53+
* the server-side error code via {@link RemoteException#getError} and typically switch and dispatch on the error
54+
* code and/or name.
5555
*/
5656
@JsonProperty("errorCode")
5757
@Value.Default
@@ -62,9 +62,9 @@ public String errorCode() {
6262
}
6363

6464
/**
65-
* A fixed name identifying the error. For errors generated from {@link ServiceException}, this corresponding to the
65+
* A fixed name identifying the error. For errors generated from {@link ServiceException}, this corresponds to the
6666
* {@link ErrorType#name} and is part of the service's API surface. Clients are given access to the service-side
67-
* error name via {@link RemoteException#getError} and typically switch&dispatch on the error code and/or name.
67+
* error name via {@link RemoteException#getError} and typically switch and dispatch on the error code and/or name.
6868
*/
6969
@JsonProperty("errorName")
7070
@Value.Default

0 commit comments

Comments
 (0)