pub enum SofError {
Show 14 variants
InvalidViewDefinition(String),
FhirPathError(String),
SerializationError(Error),
CsvError(Error),
IoError(Error),
UnsupportedContentType(String),
CsvWriterError(String),
InvalidSource(String),
SourceNotFound(String),
SourceFetchError(String),
SourceReadError(String),
InvalidSourceContent(String),
UnsupportedSourceProtocol(String),
ParquetConversionError(String),
}Expand description
Comprehensive error type for SQL-on-FHIR operations.
This enum covers all possible error conditions that can occur during ViewDefinition processing, from validation failures to output formatting issues. Each variant provides specific context about the error to aid in debugging.
§Error Categories
- Validation: ViewDefinition structure and logic validation
- Evaluation: FHIRPath expression evaluation failures
- I/O: File and serialization operations
- Format: Output format conversion issues
§Examples
use helios_sof::{SofError, SofViewDefinition, SofBundle, ContentType, run_view_definition};
match run_view_definition(view, bundle, content_type) {
Ok(output) => {
println!("Transformation successful");
},
Err(SofError::InvalidViewDefinition(msg)) => {
eprintln!("ViewDefinition validation failed: {}", msg);
},
Err(SofError::FhirPathError(msg)) => {
eprintln!("FHIRPath evaluation error: {}", msg);
},
Err(SofError::UnsupportedContentType(format)) => {
eprintln!("Unsupported output format: {}", format);
},
Err(e) => {
eprintln!("Other error: {}", e);
}
}Variants§
InvalidViewDefinition(String)
ViewDefinition structure or logic validation failed.
This error occurs when a ViewDefinition contains invalid or inconsistent configuration, such as missing required fields, invalid FHIRPath expressions, or incompatible select/unionAll structures.
FhirPathError(String)
FHIRPath expression evaluation failed.
This error occurs when a FHIRPath expression in a ViewDefinition cannot be evaluated, either due to syntax errors or runtime evaluation issues.
SerializationError(Error)
JSON serialization/deserialization failed.
This error occurs when parsing input JSON or serializing output data fails, typically due to malformed JSON or incompatible data structures.
CsvError(Error)
CSV processing failed.
This error occurs during CSV output generation, such as when writing headers or data rows to the CSV format.
IoError(Error)
File I/O operation failed.
This error occurs when reading input files or writing output files fails, typically due to permission issues or missing files.
UnsupportedContentType(String)
Unsupported output content type requested.
This error occurs when an invalid or unimplemented content type is specified for output formatting.
CsvWriterError(String)
CSV writer internal error.
This error occurs when the CSV writer encounters an internal issue that prevents successful output generation.
InvalidSource(String)
Invalid source parameter value.
This error occurs when the source parameter contains an invalid URL or path.
SourceNotFound(String)
Source not found.
This error occurs when the specified source file or URL cannot be found.
SourceFetchError(String)
Failed to fetch data from source.
This error occurs when fetching data from a remote source fails.
SourceReadError(String)
Failed to read source data.
This error occurs when reading data from the source fails.
InvalidSourceContent(String)
Invalid content in source.
This error occurs when the source content is not valid FHIR data.
UnsupportedSourceProtocol(String)
Unsupported source protocol.
This error occurs when the source URL uses an unsupported protocol.
ParquetConversionError(String)
Parquet conversion error.
This error occurs when converting data to Parquet format fails.
Trait Implementations§
Source§impl Error for SofError
impl Error for SofError
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
Auto Trait Implementations§
impl Freeze for SofError
impl !RefUnwindSafe for SofError
impl Send for SofError
impl Sync for SofError
impl Unpin for SofError
impl UnsafeUnpin for SofError
impl !UnwindSafe for SofError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
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> Pointable for T
impl<T> Pointable for T
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.