wip: feat: define response body enum

This commit is contained in:
Jun Kurihara 2023-12-12 19:58:33 +09:00
commit 008b62a925
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
12 changed files with 215 additions and 104 deletions

View file

@ -84,35 +84,15 @@ pub enum RpxyError {
#[error("Failed to fetch from upstream: {0}")]
FailedToFetchFromUpstream(String),
// Cache errors,
#[cfg(feature = "cache")]
#[error("Invalid null request and/or response")]
NullRequestOrResponse,
#[cfg(feature = "cache")]
#[error("Failed to write byte buffer")]
FailedToWriteByteBufferForCache,
#[cfg(feature = "cache")]
#[error("Failed to acquire mutex lock for cache")]
FailedToAcquiredMutexLockForCache,
#[cfg(feature = "cache")]
#[error("Failed to create file cache")]
FailedToCreateFileCache,
#[cfg(feature = "cache")]
#[error("Failed to write file cache")]
FailedToWriteFileCache,
#[cfg(feature = "cache")]
#[error("Failed to open cache file")]
FailedToOpenCacheFile,
// Upstream connection setting errors
#[error("Unsupported upstream option")]
UnsupportedUpstreamOption,
// Cache error map
#[cfg(feature = "cache")]
#[error("Cache error: {0}")]
CacheError(#[from] crate::forwarder::CacheError),
// Others
#[error("Infallible")]
Infallible(#[from] std::convert::Infallible),