Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correctly categorize Error types #2335

Open
broccoliSpicy opened this issue May 14, 2024 · 0 comments
Open

correctly categorize Error types #2335

broccoliSpicy opened this issue May 14, 2024 · 0 comments

Comments

@broccoliSpicy
Copy link
Contributor

broccoliSpicy commented May 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant