Skip to content

Conversation

gabotechs
Copy link

@gabotechs gabotechs commented Aug 21, 2025

Addresses #978

This PR keeps the tonic::transport::Error constructor methods private while allowing external users to map BoxErrors into tonic::transpoert::Error, which makes it possible to do something like:

fn test() -> Result<(), crate::transport::Error> {
    let err = Err(crate::BoxError::from("test"));
    err?;
    Ok(())
}

More details about why users would want to build tonic::transport::Error in the issue.

Also, completely open to alternatives.

@LucioFranco
Copy link
Member

What is the use case here, its not construct-able publicly for a reason.

@gabotechs
Copy link
Author

What is the use case here, its not construct-able publicly for a reason.

this comment explains it:
#978 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants