#[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>,
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: ModelValidationPhaseClassified
A structured engine or remote-contract failure mapped into stable client-owned categories, codes, and paths.
SchemaVerification
Schema verification or installation failed.
Connection
Connection to the database failed.
QueryExecution
Database query or operation failed.
Transaction
Database transaction failed.
NotFound
Requested schema element or database entity was not found.
Database
Underlying database error.
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 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 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