go-error-mapper

Community

Map Go errors to gRPC/HTTP codes.

Authorsaddam-eng-tech
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses the common issue in Go microservices where developers tend to return generic codes.Internal errors, obscuring the actual domain-specific error conditions and hindering proper error handling by clients.

Core Features & Use Cases

  • Typed Domain Errors: Define custom, typed errors that represent specific business logic failures.
  • gRPC Status Mapping: Automatically map these domain errors to appropriate gRPC status codes (e.g., NotFound, InvalidArgument).
  • HTTP Status Mapping: Optionally map domain errors to corresponding HTTP status codes for RESTful APIs.
  • Stack Trace Capture: Includes optional stack trace capture for enhanced debugging.
  • Use Case: When a user is not found, instead of returning codes.Internal, this skill ensures the service returns codes.NotFound, allowing the client to handle this specific scenario gracefully.

Quick Start

Generate a Go error handling package that maps domain errors to gRPC and HTTP status codes.

Dependency Matrix

Required Modules

None required

Components

scriptsreferences

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: go-error-mapper
Download link: https://github.com/saddam-eng-tech/ai-agent-skills/archive/main.zip#go-error-mapper

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.