Package io.servicetalk.grpc.internal
Class GrpcStatusUtils
java.lang.Object
io.servicetalk.grpc.internal.GrpcStatusUtils
Provides utilities around percent-encoding and decoding the GRPC status message.
Note that much of the actual encoding and decoding logic is borrowed from the io.grpc.Status
class,
specifically the io.grpc.Status#StatusMessageMarshaller
.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic CharSequence
getStatusMessage
(HttpHeaders headers) Tries to read the status message from theHttpHeaders
and percent-decode if necessary.static void
setStatusMessage
(HttpHeaders headers, CharSequence message) Sets and potentially encodes the given status message.
-
Field Details
-
GRPC_STATUS_MESSAGE
-
-
Method Details
-
setStatusMessage
Sets and potentially encodes the given status message.- Parameters:
headers
- the headers on where to set the message.message
- the message to set.
-
getStatusMessage
Tries to read the status message from theHttpHeaders
and percent-decode if necessary.- Parameters:
headers
- the headers to load and decode the status message from.- Returns:
- the decoded status message, or null of no message found in the header provided.
-