pub enum SqlError {
Parse {
message: String,
location: ErrorLocation,
code: &'static str,
},
Plan {
message: String,
location: ErrorLocation,
code: &'static str,
},
Execution {
message: String,
code: &'static str,
},
Storage {
message: String,
code: &'static str,
source: Option<Error>,
},
Catalog {
message: String,
location: ErrorLocation,
code: &'static str,
},
}Expand description
統一 SQL エラー型(公開 API)。
§Examples
use alopex_sql::SqlError;
use alopex_sql::StorageError;
let err = SqlError::from(StorageError::TransactionConflict);
assert_eq!(err.code(), "ALOPEX-S001");Variants§
Parse
パースエラー。
Plan
プランニングエラー(型エラー等)。
Execution
実行エラー。
Storage
ストレージエラー(REQ-4-3: source を保持してエラーチェーンを維持)。
Catalog
カタログエラー(テーブル/インデックス等の参照・整合性)。
Implementations§
Trait Implementations§
Source§impl Error for SqlError
impl Error for SqlError
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<CatalogError> for SqlError
impl From<CatalogError> for SqlError
Source§fn from(value: CatalogError) -> Self
fn from(value: CatalogError) -> Self
Converts to this type from the input type.
Source§impl From<ExecutorError> for SqlError
impl From<ExecutorError> for SqlError
Source§fn from(value: ExecutorError) -> Self
fn from(value: ExecutorError) -> Self
Converts to this type from the input type.
Source§impl From<ParserError> for SqlError
impl From<ParserError> for SqlError
Source§fn from(value: ParserError) -> Self
fn from(value: ParserError) -> Self
Converts to this type from the input type.
Source§impl From<PlannerError> for SqlError
impl From<PlannerError> for SqlError
Source§fn from(value: PlannerError) -> Self
fn from(value: PlannerError) -> Self
Converts to this type from the input type.
Source§impl From<StorageError> for SqlError
impl From<StorageError> for SqlError
Source§fn from(value: StorageError) -> Self
fn from(value: StorageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SqlError
impl !RefUnwindSafe for SqlError
impl Send for SqlError
impl Sync for SqlError
impl Unpin for SqlError
impl !UnwindSafe for SqlError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more