sw-errors 0.0.8

A library for error parsing and pretty-printing, used across the swtools toolset.
Documentation
# 📦 sw-errors

A Rust library for parsing and displaying error messages in a clearer and more user-friendly way.

## ✨ Features

- Structured error parsing
- Human-friendly error display
- Support for multiple output formats (JSON, plain text, etc.)
- Easy integration with logging or CLI tools

## 🚀 Installation

Add this to your `Cargo.toml`:

```toml
[dependencies]
sw-errors = "0.1"
```

## 🛠️ Usage example

```rust
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());
}
```

## 🧠 How it works

This library analyzes raw error messages and extracts useful information such as:

- Error type
- Code location
- Root cause (if available)

## 💡 Motivation

Rust error messages can often be verbose or hard to understand, especially for beginners. This library aims to make them more readable and approachable.

## 📋 Roadmap

- [x] Parser for common panics
- [ ] Support for `anyhow::Error`
- [ ] Support for `thiserror`
- [ ] CLI tool to pretty-print errors in the terminal

## 🤝 Contributing

Contributions are very welcome! Check out the [CONTRIBUTING.md](./CONTRIBUTING.md) file to get started.

## 📄 License

[Apache 2.0](./LICENSE)