Skip to content

Return Result in EvalNamespace::lookup #10

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

Open
optozorax opened this issue Mar 15, 2021 · 0 comments
Open

Return Result in EvalNamespace::lookup #10

optozorax opened this issue Mar 15, 2021 · 0 comments

Comments

@optozorax
Copy link

Hi, thanks for the great crate!

I want to return a Result with my error type in the lookup function in the EvalNamespace object. For example, there can be recursion where a is dependent on value a, and I can tell this only when the lookup function is called. And I want to show in an error message that problem exactly in the recursion of user-defined formulas.

I believe this can be done by adding an Error associated type to EmptyNamespace and return something like Result<f64, Either<Self::Error, fasteval::Error>> from the lookup function.

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