pub enum LangExtractError {
ConfigurationError(String),
InferenceError {
message: String,
provider: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
InvalidInput(String),
NetworkError(Error),
ParsingError(String),
IoError(Error),
SerializationError(String),
ProcessingError(String),
TokenizationError(String),
ChunkingError(String),
VisualizationError(String),
UnexpectedError(String),
}
Expand description
Base error type for all LangExtract operations
This enum covers all possible error conditions that can occur during text extraction and processing.
Variants§
ConfigurationError(String)
Configuration-related errors (missing API keys, invalid model IDs, etc.)
InferenceError
Runtime inference errors (API failures, network issues, etc.)
InvalidInput(String)
Invalid input provided to the library
NetworkError(Error)
Network-related errors (URL download failures, etc.)
ParsingError(String)
JSON/YAML parsing errors
IoError(Error)
I/O errors (file operations, etc.)
SerializationError(String)
Serialization/deserialization errors
ProcessingError(String)
Text processing errors (chunking, alignment, etc.)
TokenizationError(String)
Tokenization errors
ChunkingError(String)
Chunking errors
VisualizationError(String)
Visualization errors
UnexpectedError(String)
Generic error for unexpected conditions
Implementations§
Source§impl LangExtractError
impl LangExtractError
Sourcepub fn configuration<S: Into<String>>(message: S) -> Self
pub fn configuration<S: Into<String>>(message: S) -> Self
Create a new configuration error
Sourcepub fn inference<S: Into<String>>(
message: S,
provider: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn inference<S: Into<String>>( message: S, provider: Option<String>, source: Option<Box<dyn Error + Send + Sync>>, ) -> Self
Create a new inference error with provider information
Sourcepub fn inference_simple<S: Into<String>>(message: S) -> Self
pub fn inference_simple<S: Into<String>>(message: S) -> Self
Create a new inference error without provider information
Sourcepub fn invalid_input<S: Into<String>>(message: S) -> Self
pub fn invalid_input<S: Into<String>>(message: S) -> Self
Create a new invalid input error
Sourcepub fn serialization<S: Into<String>>(message: S) -> Self
pub fn serialization<S: Into<String>>(message: S) -> Self
Create a new serialization error
Sourcepub fn processing<S: Into<String>>(message: S) -> Self
pub fn processing<S: Into<String>>(message: S) -> Self
Create a new processing error
Sourcepub fn tokenization<S: Into<String>>(message: S) -> Self
pub fn tokenization<S: Into<String>>(message: S) -> Self
Create a new tokenization error
Sourcepub fn visualization<S: Into<String>>(message: S) -> Self
pub fn visualization<S: Into<String>>(message: S) -> Self
Create a new visualization error
Sourcepub fn unexpected<S: Into<String>>(message: S) -> Self
pub fn unexpected<S: Into<String>>(message: S) -> Self
Create a new unexpected error
Sourcepub fn is_configuration_error(&self) -> bool
pub fn is_configuration_error(&self) -> bool
Check if this error is related to configuration
Sourcepub fn is_inference_error(&self) -> bool
pub fn is_inference_error(&self) -> bool
Check if this error is related to inference
Sourcepub fn is_network_error(&self) -> bool
pub fn is_network_error(&self) -> bool
Check if this error is related to network issues
Sourcepub fn is_parsing_error(&self) -> bool
pub fn is_parsing_error(&self) -> bool
Check if this error is related to parsing
Trait Implementations§
Source§impl Debug for LangExtractError
impl Debug for LangExtractError
Source§impl Display for LangExtractError
impl Display for LangExtractError
Source§impl Error for LangExtractError
impl Error for LangExtractError
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
Source§impl From<Error> for LangExtractError
impl From<Error> for LangExtractError
Source§impl From<Error> for LangExtractError
impl From<Error> for LangExtractError
Source§impl From<Error> for LangExtractError
impl From<Error> for LangExtractError
Source§impl From<Error> for LangExtractError
impl From<Error> for LangExtractError
Source§impl From<Error> for LangExtractError
impl From<Error> for LangExtractError
Source§impl From<InferenceError> for LangExtractError
impl From<InferenceError> for LangExtractError
Source§fn from(err: InferenceError) -> Self
fn from(err: InferenceError) -> Self
Source§impl From<ResolverError> for LangExtractError
impl From<ResolverError> for LangExtractError
Source§fn from(err: ResolverError) -> Self
fn from(err: ResolverError) -> Self
Source§impl From<TemplateError> for LangExtractError
impl From<TemplateError> for LangExtractError
Source§fn from(err: TemplateError) -> Self
fn from(err: TemplateError) -> Self
Auto Trait Implementations§
impl Freeze for LangExtractError
impl !RefUnwindSafe for LangExtractError
impl Send for LangExtractError
impl Sync for LangExtractError
impl Unpin for LangExtractError
impl !UnwindSafe for LangExtractError
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.