Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

human-panic

> 设计协作
Open source

Panic messages for humans.

1.9K stars0 likes3 views
WebsiteGitHub

About

Panic messages for humans.

human-panic

crates.io version build status downloads docs.rs docs

Panic messages for humans. Handles panics by calling std::panic::set_hook to make errors nice for humans.

  • Documentation
  • Crates.io

Why?

When you're building a CLI, polish is super important. Even though Rust is pretty great at safety, it's not unheard of to access the wrong index in a vector or have an assert fail somewhere.

When an error eventually occurs, you probably will want to know about it. So instead of just providing an error message on the command line, we can create a call to action for people to submit a report.

This should empower people to engage in communication, lowering the chances people might get frustrated. And making it easier to figure out what might be causing bugs.

Default Output

txt
thread 'main' panicked at 'oops', examples/main.rs:2:3
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Human-Panic Output

…

The error dump file generated by human-panic contains the following fields.

…

Usage

rust
use human_panic::setup_panic;

fn main() {
   setup_panic!();

   println!("A normal log message");
   panic!("OMG EVERYTHING IS ON FIRE!!!")
}

It only displays a human-friendly panic message in release mode:

bash
$ cargo run --release

Installation

bash
$ cargo add human-panic

License

Licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or https://opensource.org/license/mit)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rusthuman-centered-designpanic-hookrust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category设计协作
PricingOpen source

> Related tools

F
Figma
协作式界面设计工具
S
sketch-wakatime
Sketch plugin for automatic time tracking and metrics generated from your Sketch usage.
Q
QuickColor
Quickly apply fills from the global or document color palettes to selected elements - 🎨