Skip to content

Colorful errors #1732

@Sk7Str1p3

Description

@Sk7Str1p3

Summary 💡

Implement colored error and panic reports

Motivation 🔦

As a follow-up to #1634, which added colour to the CLI interface, we should implement something similar for errors and panics. I think this would make them easier to read and more user-friendly.

I came up with 3 options of implementing this:
1). Simply replace anyhow with color-eyre

  • pros:
    • easy to drop-in replace anyhow
  • cons:
    • bring some odd dependencies (e.g. tracing, backtrace)
    • not that flexible, can be confusing if .context() called many times
  1. Add eyre and implement custom error report
  • pros:
    • easy to drop-in replace anyhow
    • customisable
  • cons:
    • reports are not so detailed, requires many extension traits to get detailed report
    • can be confusing if error has many sources
  1. Use miette
  • pros:
    • really comprehensive and beatiful error reports
    • derive macros for error types
  • cons:
    • probably overkill
    • 2MB built with --release, really big crate

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions