Skip to content

Improve error handling #400

@CaliViking

Description

@CaliViking

Thank you for creating this library.
There is a feature that I am struggling with. The library uses anyhow for error handling, this makes it hard to programmatically handle errors as I have to downcast errors to the actual errors. An example is init_file(). There are a few issues with this:

  • I have to know what I can downcast to. The only way to find out is to dig around and experiment.
  • The approach is counter to how I understand the intent of Rust. Rust is supposed to be explicit.
  • I believe it is counter to how anyhow is intended to be used. My understanding is that anyhow is intended for top-level error handling at the application level, not error handling at a library level.

I struggle with error handling at other levels as well. How do I programmatically detect that logging has failed? Nothing is returned from error!(), warn!(), info!() macros.

I am not sure if this is a feature request, a bug, or just me misunderstanding how to use Rust and log4rs.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions