-
Notifications
You must be signed in to change notification settings - Fork 11
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
Passing errors from subsystems to application code instead of simply printing them #20
Comments
Working on it :) Currently hard to do due to implementation problems, but I'm working on a full rewrite. The goal is to provide, additionally to a I can't do both at the same time, though, because Errors usually don't implement The background for that change is that I want to implement the ability to spawn one decoupled subsystem per connection, in servers. I will write an echo server that prints a goodbye message to all connected clients on shutdown. Does that work towards your usecase? I can't promise an ETA though, as this I obviously don't work full time on this project. |
Conceptually a subsystem has only 1 parent, so why would the error need to be Clone/Copy? It can just Not sure about the panic stuff, I'm too unfamiliar with now this library works to comment on that. |
I think it will make sense when you see the API I have in mind :) But yes, I plan to, instead of printing the errors, to return them in a wrapping error to the user. |
@TheButlah I didn't manage to make the error types configurable yet, but at least they are now attached to the error: https://github.com/Finomnis/tokio-graceful-shutdown/blob/main/src/errors.rs Does that help for your usecase? |
Its a start, but the error type is still a trait object, which makes it hard to actually handle the error. For example, if the error is a |
I'm still working on that, but it turns out to be much harder than expected. If you want to follow, here:
It works if I ditch the neat error formatting with miette, and it works if I leave out the If you know how to solve this, feel free to tell me ;) |
@TheButlah how is this? #27 |
Let's continue this discussion here. |
What would be involved in supporting such a feature? It would be cool if the parent subsystem was able to explicitly handle the child subsystem errors.
The text was updated successfully, but these errors were encountered: