awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
pkg avatar

pkg/errors

0
View on GitHub↗
8,258 stars·715 forks·Go·BSD-2-Clause·10 viewsgodoc.org/github.com/pkg/errors↗

Errors

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 independently, and creating new errors that automatically capture the call stack. For inspection, it provides mechanisms to walk the wrapped error chain to retrieve the root underlying cause or to search through the chain for an error matching a specific type or value.

Error formatting is handled through Go's standard formatting verbs, allowing developers to conditionally print stack trace details alongside error messages for diagnostic purposes. The library's design forms a linked chain of wrapped errors, enabling traversal from the outermost context down to the original error.

Features

  • Stack Trace Capture - Captures the call stack at the point of error creation or wrapping for later inspection.
  • Stack Trace Creators - Creates new error values that record the stack trace at the point of creation.
  • Chain Type Matchers - Searches through the error chain to find the first error matching a target type or value.
  • Error Wrapping - Wraps errors with descriptive messages while preserving the original error for chain traversal.
  • Chain Inspectors - Searches through wrapped error chains to find matching errors or retrieve the root cause.
  • Stack Trace Wrappers - Records stack traces at error creation and wrapping points for debugging.
  • Error Cause Mapping - Provides a function to unwrap the error chain and retrieve the root underlying cause.
  • Stack Trace Annotators - Adds a stack trace to an existing error without adding a new message.
  • Stack Trace Formatters - Prints errors with optional detailed stack trace information using standard formatting verbs.
  • Message Annotators - Adds a descriptive message to an existing error without recording a new stack trace.
  • Format Verb Stack Printers - Ships error formatting that prints stack traces conditionally via Go's fmt formatting verbs.
  • Format Verb Stack Printers - Prints detailed stack trace information using standard formatting verbs.
  • Error Handling - Simplifies error handling and wrapping.

Star history

Star history chart for pkg/errorsStar history chart for pkg/errors

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Errors

Similar open-source projects, ranked by how many features they share with Errors.
  • go-errors/errorsgo-errors avatar

    go-errors/errors

    1,005View on GitHub↗

    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

    Go
    View on GitHub↗1,005
  • dtolnay/thiserrordtolnay avatar

    dtolnay/thiserror

    5,459View on GitHub↗

    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

    Rust
    View on GitHub↗5,459
  • dtolnay/anyhowdtolnay avatar

    dtolnay/anyhow

    6,569View on GitHub↗

    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

    Rust
    View on GitHub↗6,569
  • a597873885/webfunny_monitora597873885 avatar

    a597873885/webfunny_monitor

    5,298View on GitHub↗

    webfunny_monitor is an open-source frontend monitoring and analytics platform that tracks page load performance, JavaScript errors, and user behavior. It serves as a comprehensive tool for measuring page load speed, API response times, client-side errors, and custom user events, with real-time dashboards that stream aggregated metrics via WebSocket for sub-second updates. The project distinguishes itself through its architectural approach: events are collected asynchronously via lightweight HTTP beacons and batched before transmission, while a memory-bounded local storage buffer ensures relia

    JavaScriptburying-pointfront-end-monitorfrontend-monitoring
    View on GitHub↗5,298
See all 30 alternatives to Errors→

Frequently asked questions

What does pkg/errors do?

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.

What are the main features of pkg/errors?

The main features of pkg/errors are: Stack Trace Capture, Stack Trace Creators, Chain Type Matchers, Error Wrapping, Chain Inspectors, Stack Trace Wrappers, Error Cause Mapping, Stack Trace Annotators.

What are some open-source alternatives to pkg/errors?

Open-source alternatives to pkg/errors include: go-errors/errors — errors is a Go error handling library and stack trace utility that wraps standard errors with execution call stacks… dtolnay/thiserror — thiserror is a Rust error handling library and procedural macro designed to define custom error types. It functions as… dtolnay/anyhow — Anyhow is a dynamic error handling library for Rust applications that provides a flexible error container using type… bombela/backward-cpp — backward-cpp is a C++ stack trace library and debugging utility designed to capture, resolve, and print detailed… a597873885/webfunny_monitor — webfunny_monitor is an open-source frontend monitoring and analytics platform that tracks page load performance,… ehmicky/modern-errors — This library provides a comprehensive framework for managing errors in JavaScript and TypeScript applications. It…