io.deephaven.proto.util.Exceptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-proto-backplane-grpc Show documentation
Show all versions of deephaven-proto-backplane-grpc Show documentation
The Deephaven proto-backplane-grpc
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.proto.util;
import com.google.rpc.Code;
import com.google.rpc.Status;
import io.grpc.StatusRuntimeException;
import io.grpc.protobuf.StatusProto;
public class Exceptions {
public static StatusRuntimeException statusRuntimeException(final Code statusCode,
final String details) {
return StatusProto.toStatusRuntimeException(
Status.newBuilder().setCode(statusCode.getNumber()).setMessage(details).build());
}
}