lance icon indicating copy to clipboard operation
lance copied to clipboard

correctly categorize Error types

Open broccoliSpicy opened this issue 1 year ago • 0 comments

as @wjones127 pointed out in #2316, currently our codebase has some errors that are returned as the wrong error type, for example:

HashJoiner

            return Err(Error::IO {
                message: "HashJoiner: No data".to_string(),
                location: location!(),
            });

has nothing to do with IO range_to_batches

    pub fn range_to_batches(&self, range: Range<usize>) -> Result<Vec<(i32, Range<usize>)>> {
        if range.end > *(self.batch_offsets.last().unwrap()) as usize {
            return Err(Error::IO {
                message: format!(
                    "Range {:?} is out of bounds {}",
                    range,
                    self.batch_offsets.last().unwrap()
                ),
                location: location!(),
            });
        }

should return a Error::InvalidInput

broccoliSpicy avatar May 14 '24 15:05 broccoliSpicy