go-lambda-error-handling

Implement explicit error handling for Go AWS Lambda microservices.

1|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/primolabs-org/spec-star-go --skill go-lambda-error-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-lambda-error-handling
Source: https://github.com/primolabs-org/spec-star-go/tree/main/.github/skills/go-lambda-error-handling
Command: npx skills add https://github.com/primolabs-org/spec-star-go --skill go-lambda-error-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design, review, and implement reliable error handling in Go AWS Lambda services so failures stay explicit, diagnosable, and correctly mapped at the boundary.

Core Features & Use Cases

  • Domain and application errors: Keep business rules, validation, and orchestration failures transport-agnostic and inspectable.
  • HTTP adapter mapping: Convert expected failures into safe API Gateway responses with the right status codes instead of generic Lambda errors.
  • SQS retry behavior: Classify retryable and terminal failures, support partial batch responses, and preserve FIFO ordering when required.
  • Boundary hygiene: Wrap causes with context, avoid string-based branching, and prevent transport concerns from leaking into core logic.
  • Use case: Apply this Skill when a Go Lambda microservice needs consistent error propagation across domain, application, outbound adapters, and HTTP or SQS inbound handlers.

Quick Start

Ask for a review or implementation plan that updates the Go Lambda service to use explicit wrapped errors and correct HTTP or SQS failure mapping.

Frequently Asked Questions about go-lambda-error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors in Go AWS Lambda functions without leaking transport logic into the domain?

To handle Go Lambda errors safely, wrap causes with context and keep domain failures transport-agnostic. Map expected failures into safe API Gateway responses or SQS partial batch responses at the adapter boundary, preventing HTTP or SQS concerns from leaking into core logic.

What is the best way to map SQS retry behavior and terminal failures in a Go Lambda microservice?

The best way to map SQS retry behavior in Go Lambda is to classify failures as retryable or terminal. Use partial batch responses to preserve FIFO ordering and prevent reprocessing of successful items, ensuring only terminal errors stop the batch.

How do I return safe HTTP responses from API Gateway when a Go Lambda validation or conflict fails?

To return safe HTTP responses from API Gateway, map domain and application errors to appropriate status codes at the HTTP adapter boundary. Convert validation, conflict, and dependency failures into safe responses instead of generic Lambda errors.

Does hexagonal architecture work with Go AWS Lambda for error classification and boundary mapping?

Hexagonal architecture works well with Go AWS Lambda for error classification. It separates domain, application, and adapter boundaries, allowing you to map validation, conflict, dependency, retryable, and terminal failures correctly without string-based branching.

Why does my Go Lambda service return generic errors instead of inspectable wrapped causes?

Go Lambda services return generic errors when causes are not wrapped with context. Implement explicit, inspectable error handling by wrapping causes at each boundary and classifying expected failures transport-agnostically for correct HTTP or SQS mapping.

When do I need partial batch SQS responses in Go Lambda error handling?

You need partial batch SQS responses in Go Lambda when processing mixed success and failure batches. Classify retryable and terminal failures, return partial batch responses to preserve FIFO ordering, and avoid reprocessing successful items on retry.