Class GrpcStatus
java.lang.Object
com.codename1.backend.grpc.GrpcStatus
The gRPC status codes, as they travel in the grpc-status trailer.
The numbers are the wire values from the gRPC specification and never change; the names are the ones every gRPC implementation prints, so a log line here reads the same as one from the peer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe call was aborted, typically by a concurrency conflict.static final intThe entity the caller tried to create already exists.static final intThe call was cancelled, usually by the caller.static final intData was lost or corrupted.static final intThe deadline passed before the call completed.static final intThe system is not in the state the call requires.static final intAn invariant the server relies on was broken.static final intThe caller sent an argument that is invalid whatever the server's state.static final intThe requested entity does not exist.static final intNot an error: the call completed.static final intA value was outside the valid range.static final intThe caller is not allowed to do this.static final intA resource, such as a quota or a message size limit, ran out.static final intThe caller has no valid credentials.static final intThe service is currently unavailable; a retry may succeed.static final intThe method is not implemented by this server.static final intAn error that fits no other code. -
Method Summary
Modifier and TypeMethodDescriptionstatic intfromHttpStatus(int httpStatus) The status a gRPC client must report for an HTTP response that carried nogrpc-statusat all, per the gRPC "HTTP to gRPC status code mapping".static Stringname(int code) The conventional name of a code, orCODE_<n>for one outside the table.static intParses agrpc-statusvalue.
-
Field Details
-
OK
public static final int OKNot an error: the call completed.- See Also:
-
CANCELLED
public static final int CANCELLEDThe call was cancelled, usually by the caller.- See Also:
-
UNKNOWN
public static final int UNKNOWNAn error that fits no other code.- See Also:
-
INVALID_ARGUMENT
public static final int INVALID_ARGUMENTThe caller sent an argument that is invalid whatever the server's state.- See Also:
-
DEADLINE_EXCEEDED
public static final int DEADLINE_EXCEEDEDThe deadline passed before the call completed.- See Also:
-
NOT_FOUND
public static final int NOT_FOUNDThe requested entity does not exist.- See Also:
-
ALREADY_EXISTS
public static final int ALREADY_EXISTSThe entity the caller tried to create already exists.- See Also:
-
PERMISSION_DENIED
public static final int PERMISSION_DENIEDThe caller is not allowed to do this.- See Also:
-
RESOURCE_EXHAUSTED
public static final int RESOURCE_EXHAUSTEDA resource, such as a quota or a message size limit, ran out.- See Also:
-
FAILED_PRECONDITION
public static final int FAILED_PRECONDITIONThe system is not in the state the call requires.- See Also:
-
ABORTED
public static final int ABORTEDThe call was aborted, typically by a concurrency conflict.- See Also:
-
OUT_OF_RANGE
public static final int OUT_OF_RANGEA value was outside the valid range.- See Also:
-
UNIMPLEMENTED
public static final int UNIMPLEMENTEDThe method is not implemented by this server.- See Also:
-
INTERNAL
public static final int INTERNALAn invariant the server relies on was broken.- See Also:
-
UNAVAILABLE
public static final int UNAVAILABLEThe service is currently unavailable; a retry may succeed.- See Also:
-
DATA_LOSS
public static final int DATA_LOSSData was lost or corrupted.- See Also:
-
UNAUTHENTICATED
public static final int UNAUTHENTICATEDThe caller has no valid credentials.- See Also:
-
-
Method Details
-
name
The conventional name of a code, orCODE_<n>for one outside the table.- Parameters:
code- a gRPC status code- Returns:
- its name
-
fromHttpStatus
public static int fromHttpStatus(int httpStatus) The status a gRPC client must report for an HTTP response that carried nogrpc-statusat all, per the gRPC "HTTP to gRPC status code mapping".- Parameters:
httpStatus- the HTTP status of the response- Returns:
- the gRPC code to report
-
parse
Parses agrpc-statusvalue. Anything that is not a plain decimal number is a peer speaking something other than gRPC, reported asUNKNOWN.- Parameters:
value- the trailer value, possibly null- Returns:
- the code, or
UNKNOWNwhen the value is missing or malformed
-