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

Implement custom reconciler errors #55

Open
aran opened this issue Sep 19, 2024 · 2 comments
Open

Implement custom reconciler errors #55

aran opened this issue Sep 19, 2024 · 2 comments

Comments

@aran
Copy link
Contributor

aran commented Sep 19, 2024

In writing a custom reconciler for a data type to use with autosurgeon(with=..., I want to call a method that returns a Result.

To return an error from that Result, I need an API to allow me to construct an instance of Reconciler::Error. Currently that type is std::error::Error + From<StaleHeads>. Adding something like From<some::error::Type> or adding a method to Reconciler like error(some::error::Type) would allow me to communicate errors back to the reconcile caller.

@alexjg
Copy link
Collaborator

alexjg commented Sep 25, 2024

I wonder if we should just not have a generic type for the error but instead have it always be ReconcileError as that's what it is in practice.

@aran
Copy link
Contributor Author

aran commented Sep 25, 2024

That would work well, especially if we could add another variant for some kind of other error.

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