Package com.oracle.coherence.grpc
Class ErrorsHelper
- java.lang.Object
-
- com.oracle.coherence.grpc.ErrorsHelper
-
public final class ErrorsHelper extends Object
Error helper methods.- Since:
- 20.06
- Author:
- Jonathan Knight 2019.11.28
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.grpc.StatusRuntimeException
ensureStatusRuntimeException(Throwable t)
Convert aThrowable
to aStatusRuntimeException
.static io.grpc.StatusRuntimeException
ensureStatusRuntimeException(Throwable t, String description)
Convert aThrowable
to aStatusRuntimeException
.static Optional<String>
getRemoteStack(io.grpc.StatusException e)
Obtain the remote stack trace from the specifiedStatusException
.static Optional<String>
getRemoteStack(io.grpc.StatusRuntimeException e)
Obtain the remote stack trace from the specifiedStatusRuntimeException
.
-
-
-
Field Detail
-
KEY_ERROR
public static final io.grpc.Metadata.Key<String> KEY_ERROR
The metadata key for an exception stack trace.
-
-
Method Detail
-
ensureStatusRuntimeException
public static io.grpc.StatusRuntimeException ensureStatusRuntimeException(Throwable t)
Convert aThrowable
to aStatusRuntimeException
.- Parameters:
t
- theThrowable
to convert- Returns:
- a
StatusRuntimeException
-
ensureStatusRuntimeException
public static io.grpc.StatusRuntimeException ensureStatusRuntimeException(Throwable t, String description)
Convert aThrowable
to aStatusRuntimeException
.- Parameters:
t
- theThrowable
to convertdescription
- the description to add to the exception- Returns:
- a
StatusRuntimeException
-
getRemoteStack
public static Optional<String> getRemoteStack(io.grpc.StatusRuntimeException e)
Obtain the remote stack trace from the specifiedStatusRuntimeException
.- Parameters:
e
- the exception returned from a server call- Returns:
- the remote stack trace, or an empty
Optional
if no remote stack is present.
-
-