pub enum DataProfilerError {
Show 30 variants
#[non_exhaustive] CsvParsingError {
message: String,
suggestion: String,
source: Option<ErrorSource>,
},
FileNotFound {
path: String,
},
UnsupportedFormat {
format: String,
},
MemoryLimitExceeded,
#[non_exhaustive] InvalidConfiguration {
message: String,
suggestion: String,
source: Option<ErrorSource>,
},
InvalidSemanticHint {
message: String,
suggestion: String,
},
DataQualityIssue {
issue: String,
impact: String,
recommendation: String,
},
StreamingError {
message: String,
suggestion: String,
},
SimdUnavailable {
reason: String,
},
SamplingError {
message: String,
suggestion: String,
},
#[non_exhaustive] IoError {
message: String,
source: Option<ErrorSource>,
},
EncodingError {
path: String,
detail: String,
guess: String,
},
#[non_exhaustive] JsonParsingError {
message: String,
source: Option<ErrorSource>,
},
ColumnAnalysisError {
column: String,
reason: String,
suggestion: String,
},
RecoverableError {
message: String,
recovery_suggestion: String,
attempt: usize,
max_attempts: usize,
recovery_attempts: Vec<RecoveryAttempt>,
},
RecoveryFailed {
attempts: usize,
last_strategy: String,
recovery_log: String,
original_error: String,
},
#[non_exhaustive] ParquetError {
message: String,
source: Option<ErrorSource>,
},
#[non_exhaustive] ArrowError {
message: String,
source: Option<ErrorSource>,
},
UnsupportedDataSource {
message: String,
},
AllEnginesFailed {
message: String,
},
MetricsCalculationError {
message: String,
},
DuplicateColumnName {
names: String,
plural: String,
source_label: String,
},
ConfigValidationError {
message: String,
},
DatabaseConnectionError {
message: String,
suggestion: String,
},
DatabaseQueryError {
message: String,
},
DatabaseConfigError {
message: String,
},
DatabaseFeatureDisabled {
message: String,
},
SqlValidationError {
message: String,
},
DatabaseSslError {
message: String,
},
DatabaseRetryExhausted {
operation: String,
attempts: u32,
last_error: String,
},
}Expand description
Enhanced error types with more descriptive messages for DataProfiler
Not Clone: a retained ErrorSource is a boxed trait object, and the
originating errors (std::io::Error, csv::Error, …) are not cloneable
themselves. Cloning an error was only ever used by the recovery manager,
which now takes ownership instead.
Variants§
#[non_exhaustive]CsvParsingError
Fields
This variant is marked as non-exhaustive
source: Option<ErrorSource>FileNotFound
UnsupportedFormat
MemoryLimitExceeded
#[non_exhaustive]InvalidConfiguration
Fields
This variant is marked as non-exhaustive
source: Option<ErrorSource>InvalidSemanticHint
DataQualityIssue
StreamingError
SamplingError
#[non_exhaustive]IoError
Fields
This variant is marked as non-exhaustive
source: Option<ErrorSource>EncodingError
#[non_exhaustive]JsonParsingError
Fields
This variant is marked as non-exhaustive
source: Option<ErrorSource>ColumnAnalysisError
RecoverableError
Fields
recovery_attempts: Vec<RecoveryAttempt>RecoveryFailed
#[non_exhaustive]ParquetError
Fields
This variant is marked as non-exhaustive
source: Option<ErrorSource>#[non_exhaustive]ArrowError
Fields
This variant is marked as non-exhaustive
source: Option<ErrorSource>UnsupportedDataSource
AllEnginesFailed
MetricsCalculationError
DuplicateColumnName
ConfigValidationError
DatabaseConnectionError
DatabaseQueryError
DatabaseConfigError
DatabaseFeatureDisabled
SqlValidationError
DatabaseSslError
DatabaseRetryExhausted
Implementations§
Source§impl DataProfilerError
impl DataProfilerError
Sourcepub fn database_connection(message: &str) -> Self
pub fn database_connection(message: &str) -> Self
Create a database connection error.
The message is scrubbed of URL credentials before storage so a driver error that echoes the connection string cannot leak the password.
Sourcepub fn database_query(message: &str) -> Self
pub fn database_query(message: &str) -> Self
Create a database query error.
Redacts URL credentials that a driver error might surface; the raw SQL text and bound parameter values are never embedded by callers.
Sourcepub fn database_config(message: &str) -> Self
pub fn database_config(message: &str) -> Self
Create a database config error
Sourcepub fn database_feature_disabled(db_name: &str, feature: &str) -> Self
pub fn database_feature_disabled(db_name: &str, feature: &str) -> Self
Create a feature-not-enabled error
Sourcepub fn sql_validation(message: &str) -> Self
pub fn sql_validation(message: &str) -> Self
Create a SQL validation error
Sourcepub fn database_ssl(message: &str) -> Self
pub fn database_ssl(message: &str) -> Self
Create a database SSL error
Sourcepub fn duplicate_column_name(duplicates: &[String], source: &str) -> Self
pub fn duplicate_column_name(duplicates: &[String], source: &str) -> Self
Create a duplicate-column-name error from the already-collected list of repeated names and a short transport label.
Only the offending names and the source are embedded — never row values — so the diagnostic cannot leak cell data.
Sourcepub fn csv_parsing(original_error: &str, file_path: Option<&str>) -> Self
pub fn csv_parsing(original_error: &str, file_path: Option<&str>) -> Self
Create a CSV parsing error with helpful suggestions.
file_path is None at boundaries that do not know the source (e.g. the
From<csv::Error> conversion); pass Some(path) whenever it is known so
the suggestion can name the offending file instead of a placeholder.
Sourcepub fn csv_parsing_from<E>(original: E, file_path: Option<&str>) -> Self
pub fn csv_parsing_from<E>(original: E, file_path: Option<&str>) -> Self
Create a CSV parsing error that retains original as its source.
The suggestion is derived from the same message text as
DataProfilerError::csv_parsing, so the two forms render identically;
only the cause chain differs.
Sourcepub fn file_not_found<P: AsRef<str>>(path: P) -> Self
pub fn file_not_found<P: AsRef<str>>(path: P) -> Self
Create a file not found error with path context
Sourcepub fn unsupported_format(extension: &str) -> Self
pub fn unsupported_format(extension: &str) -> Self
Create unsupported format error with format detection
Sourcepub fn invalid_config(message: &str, suggestion: &str) -> Self
pub fn invalid_config(message: &str, suggestion: &str) -> Self
Create configuration error with specific suggestion
Sourcepub fn invalid_config_with_source<E>(
message: impl Into<String>,
suggestion: impl Into<String>,
original: E,
) -> Self
pub fn invalid_config_with_source<E>( message: impl Into<String>, suggestion: impl Into<String>, original: E, ) -> Self
Create a configuration error that retains original as its source.
Used by the TOML and glob conversions, where the underlying parser reports a position worth reaching programmatically.
Sourcepub fn data_quality_issue(
issue: &str,
impact: &str,
recommendation: &str,
) -> Self
pub fn data_quality_issue( issue: &str, impact: &str, recommendation: &str, ) -> Self
Create data quality issue with impact and recommendation
Sourcepub fn streaming_error(message: &str) -> Self
pub fn streaming_error(message: &str) -> Self
Create streaming error with context
Sourcepub fn streaming_error_with_suggestion(message: &str, suggestion: &str) -> Self
pub fn streaming_error_with_suggestion(message: &str, suggestion: &str) -> Self
Create streaming error with context and a suggested remedy
Create SIMD error with fallback information
Sourcepub fn sampling_error(message: &str, suggestion: &str) -> Self
pub fn sampling_error(message: &str, suggestion: &str) -> Self
Create sampling error with suggestion
Sourcepub fn io_error(original: Error) -> Self
pub fn io_error(original: Error) -> Self
Create an I/O error that retains original as its source.
Takes the error by value: std::io::Error is not cloneable, so a
borrowed one could only ever be stringified, which is what this issue
set out to stop. Use map_err(DataProfilerError::io_error) at call
sites.
Sourcepub fn io_message(message: &str) -> Self
pub fn io_message(message: &str) -> Self
Create an I/O error from a message, for callers with no originating error to retain (a condition detected by dataprof itself rather than reported by the OS).
Sourcepub fn json_parsing_error(original: &str) -> Self
pub fn json_parsing_error(original: &str) -> Self
Create a JSON parsing error with no retained source.
Sourcepub fn json_parsing_from<E>(original: E) -> Self
pub fn json_parsing_from<E>(original: E) -> Self
Create a JSON parsing error that retains original as its source.
Sourcepub fn csv_parsing_with_source<E>(
message: impl Into<String>,
suggestion: impl Into<String>,
original: E,
) -> Self
pub fn csv_parsing_with_source<E>( message: impl Into<String>, suggestion: impl Into<String>, original: E, ) -> Self
Create a CSV parsing error with a caller-supplied message and
suggestion that still retains original as its source.
For callers whose suggestion is specific to their own context and so
cannot come from DataProfilerError::csv_parsing’s message analysis.
Sourcepub fn json_parsing_with_source<E>(
message: impl Into<String>,
original: E,
) -> Self
pub fn json_parsing_with_source<E>( message: impl Into<String>, original: E, ) -> Self
Create a JSON parsing error with a caller-supplied message that still
retains original as its source.
Used where the message adds context the decoder does not have (a record position, a physical line number) and the decoder error is still worth keeping underneath it.
Sourcepub fn arrow_with_source<E>(message: impl Into<String>, original: E) -> Self
pub fn arrow_with_source<E>(message: impl Into<String>, original: E) -> Self
Create an Arrow error with a caller-supplied message that still retains
original as its source.
Sourcepub fn parquet_with_source<E>(message: impl Into<String>, original: E) -> Self
pub fn parquet_with_source<E>(message: impl Into<String>, original: E) -> Self
Create a Parquet error with a caller-supplied message that still retains
original as its source.
Sourcepub fn io_with_source<E>(message: impl Into<String>, original: E) -> Self
pub fn io_with_source<E>(message: impl Into<String>, original: E) -> Self
Create an I/O error with a caller-supplied message that still retains
original as its source.
Sourcepub fn arrow_error(message: &str) -> Self
pub fn arrow_error(message: &str) -> Self
Create an Arrow error with no retained source.
Sourcepub fn arrow_error_from<E>(original: E) -> Self
pub fn arrow_error_from<E>(original: E) -> Self
Create an Arrow error that retains original as its source.
Sourcepub fn parquet_error(message: &str) -> Self
pub fn parquet_error(message: &str) -> Self
Create a Parquet error with no retained source.
Sourcepub fn parquet_error_from<E>(original: E) -> Self
pub fn parquet_error_from<E>(original: E) -> Self
Create a Parquet error that retains original as its source.
Sourcepub fn column_analysis_error(
column: &str,
reason: &str,
suggestion: &str,
) -> Self
pub fn column_analysis_error( column: &str, reason: &str, suggestion: &str, ) -> Self
Create column analysis error with specific suggestion
Sourcepub fn recoverable_error(
message: &str,
recovery_suggestion: &str,
attempt: usize,
max_attempts: usize,
) -> Self
pub fn recoverable_error( message: &str, recovery_suggestion: &str, attempt: usize, max_attempts: usize, ) -> Self
Create a recoverable error that can be auto-retried
Sourcepub fn recovery_failed(
attempts: usize,
last_strategy: &str,
recovery_log: &str,
original_error: &str,
) -> Self
pub fn recovery_failed( attempts: usize, last_strategy: &str, recovery_log: &str, original_error: &str, ) -> Self
Create a recovery failed error with attempt log
Sourcepub fn add_recovery_attempt(&mut self, attempt: RecoveryAttempt)
pub fn add_recovery_attempt(&mut self, attempt: RecoveryAttempt)
Add a recovery attempt to the error
Sourcepub fn supports_auto_recovery(&self) -> bool
pub fn supports_auto_recovery(&self) -> bool
Check if error supports auto-recovery
Sourcepub fn suggested_recovery_strategies(&self) -> Vec<RecoveryStrategy>
pub fn suggested_recovery_strategies(&self) -> Vec<RecoveryStrategy>
Get suggested recovery strategies for this error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable (can continue processing)
Sourcepub fn suggestion(&self) -> Option<String>
pub fn suggestion(&self) -> Option<String>
The actionable next step for this error, as structured context.
Suggestions live in the variants and the Display string, but callers
that want to react programmatically (or render the hint separately from
the message) should read it here rather than parse the formatted output.
Trait Implementations§
Source§impl Debug for DataProfilerError
impl Debug for DataProfilerError
Source§impl Display for DataProfilerError
impl Display for DataProfilerError
Source§impl Error for DataProfilerError
impl Error for DataProfilerError
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()
Source§impl From<Error> for DataProfilerError
Convert from anyhow::Error to DataProfilerError with context.
impl From<Error> for DataProfilerError
Convert from anyhow::Error to DataProfilerError with context.
These conversions run where the source path/operation is not known, so they
never fabricate one: a path is only ever attached by the call sites that hold
it (see DataProfilerError::csv_parsing, map_io_error, and the facade’s
existence check). Preserving the original message keeps the source diagnostic.
Source§impl From<Error> for DataProfilerError
Convert from std::io::Error to DataProfilerError.
impl From<Error> for DataProfilerError
Convert from std::io::Error to DataProfilerError.
Path-less by design: callers that know the file use map_io_error to produce
a DataProfilerError::FileNotFound with the real path. Here we keep the OS
message (which already names the condition) rather than guessing a path.
Source§impl From<Error> for DataProfilerError
Convert from csv::Error to DataProfilerError with enhanced context.
impl From<Error> for DataProfilerError
Convert from csv::Error to DataProfilerError with enhanced context.
The source path is unknown at this boundary, so the suggestion is written
without a filename rather than the misleading 'unknown' placeholder.
Source§impl From<Error> for DataProfilerError
Convert from serde_json::Error to DataProfilerError
impl From<Error> for DataProfilerError
Convert from serde_json::Error to DataProfilerError
Source§impl From<Error> for DataProfilerError
Convert from toml::de::Error to DataProfilerError
impl From<Error> for DataProfilerError
Convert from toml::de::Error to DataProfilerError
Source§impl From<Error> for DataProfilerError
Convert from toml::ser::Error to DataProfilerError
impl From<Error> for DataProfilerError
Convert from toml::ser::Error to DataProfilerError
Source§impl From<PatternError> for DataProfilerError
Convert from glob::PatternError to DataProfilerError
impl From<PatternError> for DataProfilerError
Convert from glob::PatternError to DataProfilerError