def grpc_status_code(err: BentoMLException) -> grpc.StatusCode:
    """
    Convert BentoMLException.error_code to grpc.StatusCode.
    """
    return http_status_to_grpc_status_map().get(err.error_code, grpc.StatusCode.UNKNOWN)
Convert BentoMLException.error_code to grpc.StatusCode.
src/bentoml/grpc/utils/__init__.py