#[non_exhaustive]pub enum Error {
ModelValidation {
phase: ModelValidationPhase,
code: String,
path: Vec<String>,
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
Classified {
category: ErrorCategory,
phase: Option<ModelValidationPhase>,
code: String,
path: Vec<String>,
diagnostic: Option<Box<ErrorDiagnostic>>,
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
SchemaVerification {
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
Connection {
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
QueryExecution {
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
Transaction {
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
NotFound {
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
Database {
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
Other {
message: String,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
},
}Expand description
Primary error type for the TypeBridge client SDK.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ModelValidation
Generated-model evidence did not match the installed schema projection.
Fields
phase: ModelValidationPhaseValidation stage at which the evidence failed.
Classified
A structured engine or remote-contract failure mapped into stable client-owned categories, codes, and paths.
Fields
category: ErrorCategoryStable public error category.
phase: Option<ModelValidationPhase>Model-validation phase when applicable to this failure.
diagnostic: Option<Box<ErrorDiagnostic>>Typed engine or remote diagnostic metadata, when supplied.
SchemaVerification
Schema verification or installation failed.
Fields
Connection
Connection to the database failed.
Fields
QueryExecution
Database query or operation failed.
Fields
Transaction
Database transaction failed.
Fields
NotFound
Requested schema element or database entity was not found.
Fields
Database
Underlying database error.
Fields
Other
Client request or execution error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn remote(
code: impl Into<String>,
message: impl Into<String>,
source: Option<Box<dyn StdError + Send + Sync + 'static>>,
) -> Self
pub fn remote( code: impl Into<String>, message: impl Into<String>, source: Option<Box<dyn StdError + Send + Sync + 'static>>, ) -> Self
Construct one application-owned remote transport failure.
Transport implementations should use a stable lowercase snake-case code so callers can handle the failure without parsing its message.
Sourcepub const fn category(&self) -> ErrorCategory
pub const fn category(&self) -> ErrorCategory
Return the stable public failure category.
Sourcepub fn sdk_category(&self) -> Option<&'static str>
pub fn sdk_category(&self) -> Option<&'static str>
Return the exact common SDK diagnostic category, when this error directly retains one.
This is an additive, lossless view for generated manager and projected
batch diagnostics. Self::category remains the released Rust
compatibility classification and may intentionally map SDK
invalid_input to ErrorCategory::ModelValidation.
Sourcepub fn code(&self) -> Option<&str>
pub fn code(&self) -> Option<&str>
Return the stable machine-readable failure code, when available.
Sourcepub fn path(&self) -> Option<&[String]>
pub fn path(&self) -> Option<&[String]>
Return the owned structured diagnostic path, when available.
Sourcepub fn diagnostic_path(&self) -> Option<&[ErrorPathSegment]>
pub fn diagnostic_path(&self) -> Option<&[ErrorPathSegment]>
Return the typed diagnostic path, when the source supplied one.
Self::path remains available as the compatibility-oriented textual
projection of the same path.
Sourcepub fn details(&self) -> Option<&BTreeMap<String, ErrorDetail>>
pub fn details(&self) -> Option<&BTreeMap<String, ErrorDetail>>
Return deterministic typed diagnostic details, when available.
Sourcepub const fn model_validation_phase(&self) -> Option<ModelValidationPhase>
pub const fn model_validation_phase(&self) -> Option<ModelValidationPhase>
Return the model-validation phase, when applicable.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request