private static Status getStatus ( Throwable throwable ) { Status status = Status . UNKNOWN ; if ( throwable instanceof StatusRuntimeException ) { status = ( ( StatusRuntimeException ) throwable ) . getStatus ( ) ; } else if ( throwable instanceof StatusException ) { status = ( ( StatusException ) throwable ) . getStatus ( ) ; } return status ; }
Extracts the GRPC status code if available . Returns UNKNOWN for non - GRPC exceptions .