| 502 | } |
| 503 | |
| 504 | fn error_prefix(&self) -> &'static str { |
| 505 | match self { |
| 506 | DataFusionError::ArrowError(_, _) => "Arrow error: ", |
| 507 | #[cfg(feature = "parquet")] |
| 508 | DataFusionError::ParquetError(_) => "Parquet error: ", |
| 509 | #[cfg(feature = "object_store")] |
| 510 | DataFusionError::ObjectStore(_) => "Object Store error: ", |
| 511 | DataFusionError::IoError(_) => "IO error: ", |
| 512 | #[cfg(feature = "sql")] |
| 513 | DataFusionError::SQL(_, _) => "SQL error: ", |
| 514 | DataFusionError::NotImplemented(_) => { |
| 515 | "This feature is not implemented: " |
| 516 | } |
| 517 | DataFusionError::Internal(_) => "Internal error: ", |
| 518 | DataFusionError::Plan(_) => "Error during planning: ", |
| 519 | DataFusionError::Configuration(_) => { |
| 520 | "Invalid or Unsupported Configuration: " |
| 521 | } |
| 522 | DataFusionError::SchemaError(_, _) => "Schema error: ", |
| 523 | DataFusionError::Execution(_) => "Execution error: ", |
| 524 | DataFusionError::ExecutionJoin(_) => "ExecutionJoin error: ", |
| 525 | DataFusionError::ResourcesExhausted(_) => { |
| 526 | "Resources exhausted: " |
| 527 | } |
| 528 | DataFusionError::External(_) => "External error: ", |
| 529 | DataFusionError::Context(_, _) => "", |
| 530 | DataFusionError::Substrait(_) => "Substrait error: ", |
| 531 | DataFusionError::Diagnostic(_, _) => "", |
| 532 | DataFusionError::Collection(errs) => { |
| 533 | errs.first().expect("cannot construct DataFusionError::Collection with 0 errors, but got one such case").error_prefix() |
| 534 | } |
| 535 | DataFusionError::Shared(_) => "", |
| 536 | DataFusionError::Ffi(_) => "FFI error: ", |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | pub fn message(&self) -> Cow<'_, str> { |
| 541 | match *self { |