grpc / grpc/grpc-rust

Make `transport::error::Kind` public, for better programmatic error handling

Open
#2,563 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
12.5k
Forks
1.3k
Avg merge
4d 7h
Merged PRs (30d)
24

Description

## Feature Request

### Crates

`tonic`

### Motivation

The `transport::error::Error` type is quite opaque, and not amenable to programmatically distinguishing between different types of errors.

### Proposal

There is a `Kind` enum that is currently `pub(crate)`; I suggest making this `pub` and adding a public accessor to return the `Kind`.

If forwards-compatibility with potential future variants is a concern, the `non_exhaustive` attribute can be applied to the enum.

### Alternatives

A set of public functions returning `bool` could be added to cover each type of error: `is_transport_error`, `is_invalid_uri`, etc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.