chore: add an opaque error type in meta (#890)

add a boxed error type in meta
This commit is contained in:
fys
2023-01-18 11:30:54 +08:00
committed by GitHub
parent ecb71f81be
commit 49d83abc0c

View File

@@ -159,6 +159,12 @@ pub enum Error {
selector_type: String,
backtrace: Backtrace,
},
#[snafu(display("An error occurred in Meta, source: {}", source))]
MetaBoxedError {
#[snafu(backtrace)]
source: BoxedError,
},
}
pub type Result<T> = std::result::Result<T, Error>;
@@ -207,6 +213,7 @@ impl ErrorExt for Error {
| Error::InvalidTxnResult { .. } => StatusCode::Unexpected,
Error::TableNotFound { .. } => StatusCode::TableNotFound,
Error::InvalidCatalogValue { source, .. } => source.status_code(),
Error::MetaBoxedError { source } => source.status_code(),
}
}
}