thehardwarestore.ai

where AI agents shop for the right tools

── 99422 repos indexed ── | filtered by tag: #error-handling
samber/oops ★ 990 45 APPLICATION

Oops is a Go library for structured error handling that serves as a drop-in replacement for the standard error type. It provides a fluent builder pattern to attach rich contextual information (error codes, domains, tags, key-value attributes, user/tenant data, HTTP request/response, timestamps, durations, hints, ownership) to errors, along with automatic stack trace capture and optional source code fragment extraction. The library implements the standard error interface, supports error wrapping and chaining, panic recovery, assertions, and integrates with major Go logging libraries (zap, zerolog, logrus, slog) via separate formatter packages. Its architecture centers on an immutable option chain (functional options) that defers stack frame symbolization to first read, minimizing allocation overhead for errors that are created but never inspected. Key entry points are the package-level functions (Wrap, Wrapf, New, Errorf, Join, Recover, Recoverf, Assert, Assertf) and the OopsErrorBuilder chainable methods. External dependencies are minimal: only github.com/oklog/ulid/v2, github.com/samber/lo, and go.opentelemetry.io/otel/trace for optional OpenTelemetry span context extraction. The codebase is well-tested, benchmarked, and follows Go best practices with comprehensive linting and security scanning.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 8 reusable components found
nunomaduro/collision ★ 4661 183 APPLICATION

Collision is a PHP library that provides beautiful error reporting for CLI applications, particularly integrated with Laravel, PHPUnit, and Pest. It wraps the Whoops error handler to render exceptions with syntax-highlighted code snippets, stack traces, and solution suggestions. Additionally, it includes a custom PHPUnit/Pest test printer that outputs test results with color-coded summaries, warnings, and slow-test profiling. The library is built on top of Symfony Console, Termwind, and Whoops, and is designed as a drop-in replacement for default error handling in Laravel's artisan commands and PHPUnit test runners. The codebase is well-structured with clear separation of concerns: core error rendering (Provider, Handler, Writer), terminal styling (ConsoleColor, Highlighter), argument formatting (ArgumentFormatter), code coverage reporting (Coverage), and framework-specific adapters (Laravel service provider, PHPUnit event subscribers). The PHPUnit adapter demonstrates advanced event-driven architecture by hooking into PHPUnit's event system to produce a rich, compact test output.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
PV-Bhat/vibe-check-mcp-server ★ 503 67 APPLICATION

Vibe Check MCP is a production-ready MCP (Model Context Protocol) server that provides metacognitive oversight for AI agents. It implements the research-backed Chain-Pattern Interrupt (CPI) methodology to prevent reasoning lock-in by injecting reflective pauses during agent workflows. The server exposes six tools: `vibe_check` for generating clarifying questions via a secondary LLM, `vibe_learn` for logging patterns of mistakes and successes, and three constitution management tools (`update_constitution`, `reset_constitution`, `check_constitution`) for per-session behavioral rules. It supports multiple LLM providers (Gemini, OpenAI, Anthropic, OpenRouter) with automatic fallback to static questions when the LLM is unavailable, and maintains session history for context-aware feedback. The architecture is a monolithic MCP server with dual transport modes: stdio for local agent clients (Claude Desktop, Cursor, Windsurf, VS Code) and streamable HTTP for remote access. A CLI tool (`vibe-check-mcp`) automates installation into all major MCP client configurations with atomic writes and backup creation, handles secret management via interactive prompts or env files, and provides diagnostic commands. The server includes robust HTTP security hardening: DNS-rebinding protection via Host header validation, loopback-only CORS by default with a configurable allowlist, explicit JSON body size limits, and proper JSON-RPC error responses instead of HTML pages. The codebase is well-organized with separation of concerns, extensive unit and integration tests (over 30 test files), CI/CD with security scanning, and clean abstraction layers such as a central model registry and request-scoped transport wrappers.

RATING: 8.6/10 MAINT: maintained DRIFT: low
▸ 4 reusable components found
shepmaster/snafu ★ 1897 71 APPLICATION

SNAFU is a Rust library for ergonomic error handling. It provides a `#[derive(Snafu)]` proc-macro that generates custom error types with automatic 'context selectors' (e.g., `ReadConfigSnafu`) and implements standard traits (`Display`, `Error`, `From`). The library also offers extension traits (`ResultExt`, `OptionExt`, `TryFutureExt`, `TryStreamExt`) to attach contextual information to underlying errors, macros (`ensure!`, `whatever!`) for concise error creation, and a `Report` type for user-facing error output. It supports `no_std` environments (with `alloc`) and includes backtrace capture, location tracking, and an unstable provider API for attaching arbitrary data to errors. The crate is mature and widely adopted, but contains some deprecated features (e.g., `backtraces-impl-backtrace-crate`) and a complex feature-flag matrix. The companion `snafu-derive` crate handles all proc-macro generation, and the architecture cleanly separates parsing, validation, and code generation.

RATING: 8.5/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
zellwk/zl-fetch ★ 296 32 APPLICATION

zlFetch is a lightweight JavaScript library that wraps the native Fetch API with quality-of-life improvements. It automatically parses response bodies based on `Content-Type` (JSON, text, form-urlencoded, NDJSON, Blob), provides promise-based error handling that rejects on 4xx/5xx status codes, supports request aborting, and includes shorthand methods for GET, POST, PUT, PATCH, DELETE. The library also offers streaming capabilities (SSE, NDJSON, chunked transfer), an EventSource wrapper for server-sent events, query string helpers, authorization header helpers, and a `createZlFetch` factory for pre-configured instances. The code is modular, well-typed with JSDoc, and thoroughly tested across browser and Node.js environments using vitest.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 2 reusable components found
pkg/errors ★ 8258 714 APPLICATION

This is a Go library providing error handling primitives with stack trace capture, wrapping, and cause retrieval. The primary functions are `New`, `Errorf`, `Wrap`, `Wrapf`, `WithStack`, `WithMessage`, and `Cause`. It implements the `fmt.Formatter` interface for detailed error formatting and includes compatibility with Go 1.13's `errors.Is`, `As`, and `Unwrap`. The library is self-contained with no external dependencies beyond the standard library. It is in maintenance mode as the Go standard library has adopted similar functionality, but it remains widely used for its stack trace capabilities. The architecture is a single package with a few types: `fundamental`, `withStack`, `withMessage`, and `Frame`/`StackTrace` for stack representation. The code is well-tested, well-documented, and demonstrates idiomatic Go patterns.

RATING: 8.3/10 MAINT: stale DRIFT: medium
▸ 2 reusable components found
IBM/fp-go ★ 2019 83 APPLICATION

IBM fp-go is a comprehensive functional programming library for Go, heavily inspired by fp-ts (TypeScript). It provides a wide range of algebraic abstractions including Option, Either, Result, IO, Reader, State, Writer, and their monad transformer stacks (IOEither, ReaderIOEither, ReaderIOResult, StateReaderIOEither, etc.). The library employs Go generics to simulate higher-kinded types and includes optics (lenses, prisms, isomorphisms, traversals), lazy iterators, retry policies, resource management via Bracket, dependency injection with Reader, and code generation tools. It also offers idiomatic Go wrappers that return (A, error) tuples while preserving functional composition. The codebase is split into two parallel module paths (root and v2/), with v2 representing a newer generation requiring Go 1.24+ and adding result types, effect packages, and context-aware variants. While highly engineered and feature-rich, the dual tree structure, some incomplete components, and non-standard pragmas introduce maintenance complexity.

RATING: 7.6/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
── end of results ──
$ submit: