Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Add a type for fallible record/follows-from, and error handling wrapper #106

Open
hawkw opened this issue Nov 17, 2018 · 0 comments
Open
Labels
crate/subscriber Issues related to the `tokio-trace-subscriber` crate good first issue Good for newcomers kind/enhancement New feature or request

Comments

@hawkw
Copy link
Owner

hawkw commented Nov 17, 2018

See #104:

Currently, the Subscriber::follows_from and Subscriber::record_$TYPE methods return Results. This was done so that the decision of how to handle errors that might occur when calling those methods to be made by the user (at the callsite), rather than by a library implementing Subscribers.

@carllerche suggests that the error handling decision shouldn't be made at the callsite --- as there's not much the call site can do besides either logging the error or panicking, the caller shouldn't be responsible for handling these errors. Instead, he suggests that the handling of these errors should happen between the Subscriber and the DIspatcher. We could consider adding a trait (perhaps in the tokio-trace-subscriber crate) for fallible Subscribers, and a type that wraps a fallible subscriber with customizable error-handling behaviour. That wrapper type could implement the core Subscriber infallibly.

The first part (changes to -core) was done in #105. Eventually, we should add the fallible type in the subscriber crate, if there's demand for it.

@hawkw hawkw added kind/enhancement New feature or request good first issue Good for newcomers crate/subscriber Issues related to the `tokio-trace-subscriber` crate labels Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crate/subscriber Issues related to the `tokio-trace-subscriber` crate good first issue Good for newcomers kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant