| Crates.io | sw-errors |
| lib.rs | sw-errors |
| version | 0.0.8 |
| created_at | 2025-04-20 01:57:22.078288+00 |
| updated_at | 2025-05-04 01:19:02.383531+00 |
| description | A library for error parsing and pretty-printing, used across the swtools toolset. |
| homepage | |
| repository | https://github.com/swxtz/sw-errors |
| max_upload_size | |
| id | 1641291 |
| size | 39,652 |
A Rust library for parsing and displaying error messages in a clearer and more user-friendly way.
Add this to your Cargo.toml:
[dependencies]
sw-errors = "0.1"
use sw_errors::ErrorParser;
fn main() {
let raw_error = "thread 'main' panicked at 'index out of bounds', src/main.rs:10:5";
let parsed = ErrorParser::new(raw_error).parse();
println!("{}", parsed.pretty());
}
This library analyzes raw error messages and extracts useful information such as:
Rust error messages can often be verbose or hard to understand, especially for beginners. This library aims to make them more readable and approachable.
anyhow::ErrorthiserrorContributions are very welcome! Check out the CONTRIBUTING.md file to get started.