MCPcopy Create free account
hub / github.com/grpc/grpc-java / fromCodeValue

Method fromCodeValue

api/src/main/java/io/grpc/Status.java:304–310  ·  view source on GitHub ↗

Return a Status given a canonical error Code value.

(int codeValue)

Source from the content-addressed store, hash-verified

302 * Return a {@link Status} given a canonical error {@link Code} value.
303 */
304 public static Status fromCodeValue(int codeValue) {
305 if (codeValue < 0 || codeValue >= STATUS_LIST.size()) {
306 return UNKNOWN.withDescription("Unknown code " + codeValue);
307 } else {
308 return STATUS_LIST.get(codeValue);
309 }
310 }
311
312 private static Status fromCodeValue(byte[] asciiCodeValue) {
313 if (asciiCodeValue.length == 1 && asciiCodeValue[0] == '0') {

Callers 13

cancel_doNotAcceptOkMethod · 0.95
statusForCodeMethod · 0.95
toStatusMethod · 0.95
cleanStatusMethod · 0.95
impossibleCodeValueMethod · 0.95
unaryCallMethod · 0.95
onNextMethod · 0.95
interceptCallMethod · 0.95
readStatusMethod · 0.95
parseFaultAbortMethod · 0.95

Calls 4

fromCodeValueSlowMethod · 0.95
withDescriptionMethod · 0.80
sizeMethod · 0.65
getMethod · 0.65

Tested by 5

cancel_doNotAcceptOkMethod · 0.76
impossibleCodeValueMethod · 0.76
unaryCallMethod · 0.76
onNextMethod · 0.76
interceptCallMethod · 0.76