refactor(columnq): box large error variants to fix clippy::result_large_err

This commit is contained in:
Qingping Hou 2026-03-22 13:58:50 -07:00
parent 10bc5537b5
commit 850df66fe2
3 changed files with 18 additions and 6 deletions

View File

@ -11,11 +11,15 @@ use crate::table::{self, TableIoSource, TableSource};
#[derive(Debug, Snafu)]
pub enum Error {
#[snafu(display("Could not load table data: {source}"))]
Table { source: table::Error },
Table {
#[snafu(source(from(table::Error, Box::new)))]
source: Box<table::Error>,
},
#[snafu(display("Could not resolve table extension {table_io_source}: {source}"))]
TableExtension {
table_io_source: TableIoSource,
source: table::Error,
#[snafu(source(from(table::Error, Box::new)))]
source: Box<table::Error>,
},
#[snafu(display(
"Failed to build file list for path `{fs_path}` with ext `{file_ext}`: {source}"
@ -23,7 +27,8 @@ pub enum Error {
FileList {
fs_path: String,
file_ext: String,
source: datafusion::error::DataFusionError,
#[snafu(source(from(datafusion::error::DataFusionError, Box::new)))]
source: Box<datafusion::error::DataFusionError>,
},
#[snafu(display("Failed to open file `{fpath}`: {source}"))]
FileOpen {

View File

@ -17,7 +17,10 @@ pub enum Error {
#[snafu(display("Failed to read bytes for {uri}: {source}"))]
ReadBytes { uri: String, source: reqwest::Error },
#[snafu(display("Could not load table data"))]
Table { source: table::Error },
Table {
#[snafu(source(from(table::Error, Box::new)))]
source: Box<table::Error>,
},
#[snafu(display("Invalid header: {source}"))]
HeaderName {
source: reqwest::header::InvalidHeaderName,

View File

@ -15,7 +15,8 @@ use crate::table;
pub enum Error {
#[snafu(display("Could not resolve store for url: {url}"))]
GetStore {
source: datafusion::error::DataFusionError,
#[snafu(source(from(datafusion::error::DataFusionError, Box::new)))]
source: Box<datafusion::error::DataFusionError>,
url: Url,
},
#[snafu(display("Could not get object: {path}"))]
@ -31,7 +32,10 @@ pub enum Error {
#[snafu(display("Could not read object bytes"))]
ReadObjectBytes { source: object_store::Error },
#[snafu(display("Could not load table data"))]
Table { source: table::Error },
Table {
#[snafu(source(from(table::Error, Box::new)))]
source: Box<table::Error>,
},
}
impl From<Error> for io::Error {