Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - dominikj111/error-kit: ๐Ÿฆ€ Rust error handling library built on thiserror, providing standardized error messages, ergonomic constructor functions, and type-safe error patterns for developer-focused applications.
Nothing Special   »   [go: up one dir, main page]

Skip to content

๐Ÿฆ€ Rust error handling library built on thiserror, providing standardized error messages, ergonomic constructor functions, and type-safe error patterns for developer-focused applications.

License

Notifications You must be signed in to change notification settings

dominikj111/error-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
< 8000 div class="overflow-hidden">
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

error-kit ๐Ÿฆ€ โšก

Crates.io Documentation License: BSD-3-Clause Dependency Status Made with Rust

A comprehensive, developer-focused error handling infrastructure built on top of thiserror, providing standardized error messages, common error patterns, and ergonomic helper functions.

Design Principles ๐Ÿ—๏ธ

This crate provides a "batteries-included" approach to error handling with these core principles:

Developer-Focused Messages ๐Ÿ‘ฉโ€๐Ÿ’ป

Error messages provide technical context for developers, not end-user UI text.

Type-Safe Enums Over Error Codes ๐Ÿ”ข

Uses thiserror::Error derive macro for compile-time checking, pattern matching, and IDE support.

Helper Functions Over Macros ๐Ÿš€

Explicit, debuggable functions instead of complex macros:

// Clear and debuggable โœจ
CommonError::io_error("Failed to read config file")

// Instead of macro magic ๐Ÿช„โŒ
error!("Failed to read config file")

Centralized Message Constants ๐Ÿ“š

Error messages defined as constants in a dedicated messages module for consistency and maintainability.

Usage Examples ๐Ÿ’ก

Adding error-kit to Your Project ๐Ÿ“ฆ

// Add to Cargo.toml
[dependencies]
error-kit = "0.1.0"

Using err 8A38 or-kit ๐Ÿš€

use error_kit::CommonError;

// Using helper functions ๐Ÿ”ง
let io_err = CommonError::io_error("Failed to read config file");
let filename_err = CommonError::filename_error();

// Using predefined message constants ๐Ÿ“
let timeout_err = CommonError::Timeout; // Uses messages::TIMEOUT_EXCEEDED

// Simple error handling ๐ŸŽฏ
let result: Result<Data, CommonError> = some_operation();

match result {
    Err(e) => eprintln!("Error: {}", e),
    Ok(data) => process_data(data),
}

// Or pattern matching when you need specific handling
match result {
    Err(CommonError::Io(_)) => handle_io_error(),
    Err(CommonError::Timeout) => retry_operation(),
    Err(CommonError::FilenameError) => handle_filename_issue(),
    Err(e) => eprintln!("Error: {}", e),
    Ok(data) => process_data(data),
}

Module Structure ๐Ÿ—๏ธ

The error-kit crate is organized into focused modules:

  • messages: Centralized error message constants
  • constructors: Ergonomic constructor functions
  • types: Main error enum with thiserror integration
use error_kit::{
    CommonError,          // Main error type ๐ŸŽฏ
    messages,             // Message constants ๐Ÿ“š
    constructors,         // Helper constructor functions ๐Ÿš€
};

Use Cases ๐ŸŽฏ

  • Library Development: Structured error types with consistent messaging
  • Application Development: Standardized error handling with reduced boilerplate
  • Error Infrastructure: Foundation for domain-specific error crates and company standards

Future Vision ๐Ÿ”ฎ

This crate aims to become the go-to foundation for error handling, providing:

  • Domain-specific error modules (network, filesystem, parsing, etc.)
  • Error reporting utilities and formatters
  • Integration helpers for popular crates
  • Best practice examples and patterns
  • Community-driven error message standards

Contributing ๐Ÿค

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License ๐Ÿ“„

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

About

๐Ÿฆ€ Rust error handling library built on thiserror, providing standardized error messages, ergonomic constructor functions, and type-safe error patterns for developer-focused applications.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Languages

0