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

Change Error::IO variant to hold BoxError, so it could be downcast if needed #2328

Closed
broccoliSpicy opened this issue May 13, 2024 · 0 comments · Fixed by #2329
Closed

Change Error::IO variant to hold BoxError, so it could be downcast if needed #2328

broccoliSpicy opened this issue May 13, 2024 · 0 comments · Fixed by #2329

Comments

@broccoliSpicy
Copy link
Contributor

suggested by @wjones127 in PR#2316,

to do this, we may need to define our own Error enum in each of our submodule, lance-encoding::Error, lance-file::Error, lance-index::Error etc.

wjones127 pushed a commit that referenced this issue May 20, 2024
Closes #2328 

currently, lots of error in our codebase are wrapped in Error::IO, some
are not accurate. like this one:
[source
example](https://github.com/lancedb/lance/blob/79de38027d03b049bba17c8a41f8f677dc1b110b/rust/lance/src/dataset/hash_joiner.rs#L55-60)
```rust
            return Err(Error::IO {
                message: "HashJoiner: No data".to_string(),
                location: location!(),
            });
```
this PR still wraps this error in Error::IO, as we haven't define more
precise Error type for HashJoiner yet.

we may need to define our own Error enum in each of our submodule,
lance-encoding::Error, lance-file::Error, lance-index::Error etc.
so we can write error return like this:
```rust
            let err = lance_core::Error::from(lance::dataset::Error::HashJoinerError {
                message: "HashJoiner: No data".to_string(),
                location: location!(),
            });
            Err(err)
```
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

Successfully merging a pull request may close this issue.

1 participant