For custom error definitions, the strongest matches are pkg/errors (pkg/errors is a Go error handling library that provides), ehmicky/modern-errors (This library offers a comprehensive framework for structured error) and dtolnay/thiserror (This library provides macro-driven custom error type definitions and). dtolnay/anyhow and cockroachdb/errors round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
Hand-picked custom error definition libraries for cleaner code, ranked by GitHub stars and activity. Compare the top choices and find the best fit.
pkg/errors is a Go library that provides primitives for creating, annotating, and inspecting errors with stack traces and contextual information. Its core identity centers on capturing the call stack at the point of error creation or wrapping, preserving that information for later debugging and root cause analysis. The library distinguishes itself through a set of tightly integrated capabilities for error handling. It supports wrapping errors with descriptive messages while recording a new stack trace at the wrapping point, annotating existing errors with either a message or a stack trace ind
pkg/errors is a Go error handling library that provides custom error types, stack trace capture, and error wrapping with contextual annotations.
This library provides a comprehensive framework for managing errors in JavaScript and TypeScript applications. It enables the creation of structured, type-safe error hierarchies, allowing developers to define custom error classes that ensure consistent behavior and categorization across a codebase. The project distinguishes itself through a modular plugin architecture that allows for the extension of core error functionality, such as custom logging, serialization, and validation. It includes an exception normalization pipeline that converts non-standard or malformed errors into predictable in
This library offers a comprehensive framework for structured error management in JavaScript and TypeScript with custom error hierarchies and a modular plugin architecture.
thiserror is a Rust error handling library and procedural macro designed to define custom error types. It functions as a trait implementation automator that generates the necessary code for standard library error traits at compile time. The library focuses on eliminating boilerplate by using derive macros to automatically implement display and source methods. It allows for the creation of custom error structs and enums that can map low-level errors to high-level variants while preserving the original cause and backtrace information. Its capabilities cover custom error formatting through temp
This library provides macro-driven custom error type definitions and automatic error wrapping in Rust, though it relies on standard library features rather than bundling its own standalone stack trace or serialization mechanisms.
Anyhow is a dynamic error handling library for Rust applications that provides a flexible error container using type erasure. It serves as a tool for simplifying error signatures by wrapping diverse failure types into a single object, allowing for the propagation of any error that implements the standard error trait without requiring a custom enumeration for every function. The project functions as an error context provider by attaching high-level diagnostic information and recording execution stack traces at the point of failure. It enables the recovery of concrete error implementations from
Anyhow provides flexible error wrapping, context attachment, and stack trace support for Rust applications, though it uses type erasure rather than custom error types.
Go error library with error portability over the network
CockroachDB errors is a Go error library providing structured error handling, stack traces, wrapping, context, and network serialization features.
Error handling library with readable stack traces and flexible formatting support 🎆
This Go library provides readable stack traces and flexible error formatting, fitting the error handling category well despite lacking some advanced serialization features.
Common juju errors and functions to annotate errors. Based on juju/errgo
This Go library provides structured error annotation and wrapping capabilities, making it a fitting tool for customizable error handling despite lacking built-in serialization support.
A comprehensive error handling library for Go
This library provides Go error handling with stack traces, error wrapping, and custom error types, making it a fitting tool for structured error management despite lacking some explicit serialization features.
Drop-in replacement for the standard library errors package and github.com/pkg/errors
This Go library serves as a drop-in replacement for standard error packages, providing features like custom error types, stack traces, and wrapping, though it lacks some built-in serialization and rich contextual features.
errors is a Go error handling library and stack trace utility that wraps standard errors with execution call stacks and contextual information. It captures program execution paths at the exact moment an error is initialized, extracting granular file paths, line numbers, and function symbols from raw program counter addresses. The library maintains parent-child relationships between wrapped errors to allow deep inspection, unwrapping of root causes, and combination of multiple errors into unified structures. It implements standard error interfaces so enhanced error objects can be used intercha
This Go library provides custom error wrapping and stack trace support, though it lacks built-in contextual data structures and serialization features.
PHP-Error is a web development utility and error handler that intercepts application exceptions, syntax errors, and fatal errors to replace default engine output with formatted HTML diagnostic pages during local testing. It activates automatically upon startup without requiring manual initialization calls within project code. The system features interactive diagnostics that include contextual syntax highlighting for code snippets, path-based stack trace filtering to separate external library code from application logic, and inline remote file editing capabilities that persist code modificatio
This PHP library provides customizable, prettier error reporting with stack traces, making it a relevant tool for structured error handling despite its age.
Error-or is a library that implements the result pattern to replace exception-based control flow with structured data. It provides a discriminated union implementation that encapsulates either a successful value or an error state within a single type, ensuring that operation outcomes are treated as first-class values. The library enables functional error handling by providing a fluent interface for chaining sequential operations. This monadic pipeline composition allows developers to define dependent operations that automatically short-circuit and return an error if any individual step in the
Error-or is a C# result-type library that implements discriminated unions for functional error handling, though it focuses on monadic pipelines rather than stack traces or extensive contextual error wrapping.
Simple and efficient error package
This Go package provides a straightforward approach to error handling, though it lacks explicit built-in features for stack traces and serialization support compared to more comprehensive libraries in this category.
A drop-in replacement for Go errors, with some added sugar! Unwrap user-friendly messages, HTTP status code, easy wrapping with multiple error types.
This Go error handling library provides custom wrapping and user-friendly messages as a drop-in replacement, though it lacks explicit stack trace support and serialization in the provided feature set.
Simple golang error handling with classification primitives.
This Go library provides structured error classification primitives, fitting the error handling category though it lacks explicit feature mentions for stack traces and serialization.
| المستودع | النجوم | اللغة | الترخيص | آخر تحديث |
|---|---|---|---|---|
| pkg/errors | 8.3K | Go | BSD-2-Clause | |
| ehmicky/modern-errors | 1.5K | JavaScript | MIT | |
| dtolnay/thiserror | 5.5K | Rust | Apache-2.0 | |
| dtolnay/anyhow | 6.6K | Rust | Apache-2.0 | |
| cockroachdb/errors | 2.4K | Go | Apache-2.0 | |
| rotisserie/eris | 1.8K | Go | MIT | |
| juju/errors | 1.4K | Go | NOASSERTION | |
| joomcode/errorx | 1.3K | Go | MIT | |
| emperror/errors | 204 | Go | MIT | |
| go-errors/errors | 1K | Go | MIT |