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

Refactor errors in Rust? #957

Open
etiennebacher opened this issue Mar 21, 2024 · 0 comments
Open

Refactor errors in Rust? #957

etiennebacher opened this issue Mar 21, 2024 · 0 comments
Milestone

Comments

@etiennebacher
Copy link
Collaborator

I think we should also review the various error types here:

pub enum Rctx {
#[error("Failed to handle background task")]
Background,
#[error("The argument [{0}] caused an error")]
BadArg(String),
#[error("Encountered the following error when joining the thread:\n\t{0}")]
BadJoin(String),
#[error("Got value [{0}]")]
BadVal(String),
#[error("Encountered the following error in Rust-Extendr\n\t{0}")]
Extendr(String),
#[error("Cannot access exhausted thread handler")]
Handled,
#[error("Possibly because {0}")]
Hint(String),
#[error("Expected a value of type [{0}]")]
Mistyped(String),
#[error("Expected a value that {0}")]
Misvalued(String),
#[error("Not a valid R choice because {0}")]
NotAChoice(String),
#[error("{0}")]
Plain(String),
#[error("Encountered the following error in Rust-Polars:\n\t{0}")]
Polars(String),
#[error("When {0}")]
When(String),
}

Currently we use BadVal for wrong inputs, but I don't understand the difference between BadVal, MisValued and NotAChoice

Related to #954

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

2 participants