Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Client recieve diferent error type and message #165

Open
FourLeafTec opened this issue Nov 18, 2019 · 0 comments
Open

Client recieve diferent error type and message #165

FourLeafTec opened this issue Nov 18, 2019 · 0 comments

Comments

@FourLeafTec
Copy link

In Server return a GrpcMessageError to client.

    fn send_bulk_encu(
        &self,
        _m: grpc::RequestOptions,
        req: BulkEncu,
    ) -> grpc::SingleResponse<Empty> {
        grpc::SingleResponse::err(grpc::Error::GrpcMessage(grpc::GrpcMessageError {
            grpc_status: 2,
            grpc_message: String::from("Some custom error msg"),
        }))
    }

BUT in client, I recieve a Http(CodeError(InternalError)) with message "http error: Encountered HTTP named error"

match client.send_bulk_encu(opt, data).wait_drop_metadata() {
    Ok(_) => (),
    Err(e) => {
        println!("{}",e);
        ()
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant