Correctly handle unknown http2 error code.

This commit is contained in:
Xudong Ma 2015-07-27 10:16:32 -07:00
parent 6f7c5143f1
commit e36a64e6a6
1 changed files with 3 additions and 1 deletions

View File

@ -558,7 +558,9 @@ class OkHttpClientTransport implements ClientTransport {
*/ */
@VisibleForTesting @VisibleForTesting
static Status toGrpcStatus(ErrorCode code) { static Status toGrpcStatus(ErrorCode code) {
return ERROR_CODE_TO_STATUS.get(code); Status status = ERROR_CODE_TO_STATUS.get(code);
return status != null ? status : Status.UNKNOWN.withDescription(
"Unknown http2 error code: " + code.httpCode);
} }
/** /**