grpc_quic_server/error.rs
1//! Server-side error types.
2
3use thiserror::Error;
4
5/// Errors produced by the gRPC-QUIC server.
6#[derive(Debug, Error)]
7#[non_exhaustive]
8pub enum ServerError {
9 /// Failed to bind the QUIC endpoint.
10 #[error("transport error: {0}")]
11 Transport(#[from] grpc_quic_transport::TransportError),
12
13 /// The server received a malformed request.
14 #[error("invalid request: {0}")]
15 InvalidRequest(String),
16
17 /// A stream-level I/O error occurred.
18 #[error("stream I/O error: {0}")]
19 StreamIo(#[from] std::io::Error),
20
21 /// Graceful shutdown was requested.
22 #[error("server shutting down")]
23 Shutdown,
24}