Package com.oracle.coherence.grpc
Class ErrorsHelper
java.lang.Object
com.oracle.coherence.grpc.ErrorsHelper
Error helper methods.
- Since:
- 20.06
- Author:
- Jonathan Knight 2019.11.28
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic io.grpc.StatusRuntimeExceptionConvert aThrowableto aStatusRuntimeException.static io.grpc.StatusRuntimeExceptionensureStatusRuntimeException(Throwable t, String description) Convert aThrowableto aStatusRuntimeException.getRemoteStack(io.grpc.StatusException e) Obtain the remote stack trace from the specifiedStatusException.getRemoteStack(io.grpc.StatusRuntimeException e) Obtain the remote stack trace from the specifiedStatusRuntimeException.static voidLog the exception unless it is aStatusRuntimeExceptionwith a status ofStatus.CANCELLED.
-
Field Details
-
KEY_ERROR
The metadata key for an exception stack trace.
-
-
Method Details
-
ensureStatusRuntimeException
Convert aThrowableto aStatusRuntimeException.- Parameters:
t- theThrowableto convert- Returns:
- a
StatusRuntimeException
-
ensureStatusRuntimeException
public static io.grpc.StatusRuntimeException ensureStatusRuntimeException(Throwable t, String description) Convert aThrowableto aStatusRuntimeException.- Parameters:
t- theThrowableto convertdescription- the description to add to the exception- Returns:
- a
StatusRuntimeException
-
getRemoteStack
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
Optionalif no remote stack is present.
-
getRemoteStack
Obtain the remote stack trace from the specifiedStatusException.- Parameters:
e- the exception returned from a server call- Returns:
- the remote stack trace, or an empty
Optionalif no remote stack is present.
-
logIfNotCancelled
Log the exception unless it is aStatusRuntimeExceptionwith a status ofStatus.CANCELLED.- Parameters:
t- the exception to log
-