Skip to content

Commit

Permalink
fix: CheckedApiException should not prepend com.google.api.gax.rpc.Ap…
Browse files Browse the repository at this point in the history
…iException to its message. (#1178)

* fix: CheckedApiException should not prepend com.google.api.gax.rpc.ApiException to its message.

* fix
  • Loading branch information
dpcollins-google authored Jul 28, 2022
1 parent 93ca8c7 commit b264d4a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
public class CheckedApiException extends Exception {
public final ApiException underlying;

public CheckedApiException(ApiException underlying) {
super(underlying);
this.underlying = underlying;
}

public static StatusCode fromCode(StatusCode.Code code) {
return new StatusCode() {
@Override
Expand All @@ -47,6 +42,11 @@ public Object getTransportCode() {
};
}

public CheckedApiException(ApiException underlying) {
super(underlying.getMessage(), underlying);
this.underlying = underlying;
}

public CheckedApiException(String message, @Nullable Throwable cause, StatusCode.Code code) {
this(new ApiException(message, cause, fromCode(code), false));
}
Expand Down

0 comments on commit b264d4a

Please sign in to comment.