gorm-error-handling

Community

Streamlined GORM error handling for Go projects

Authorliurida
Version1.0.0
Installs0

System Documentation

What problem does it solve?

GORM operations often return errors that, if not handled correctly, can cause crashes, data corruption, or silent failures, making debugging and reliability difficult.

Core Features & Use Cases

  • Unified Error Types: Standardized error constants like ErrRecordNotFound, ErrDuplicatedKey, and transaction errors.
  • TranslateError Support: Enables database‑agnostic error handling across MySQL, PostgreSQL, SQLite, and SQL Server.
  • Practical Patterns: Service‑layer wrappers, transaction rollback handling, and row‑affected checks for CRUD operations.
  • Use Case Example: In a Go microservice, use this skill to detect duplicate key violations during user creation and return a friendly “user already exists” message.

Quick Start

Invoke the skill with a request to check for errors after a GORM operation and receive a summarized handling strategy.

Dependency Matrix

Required Modules

None required

Components

references

💻 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: gorm-error-handling
Download link: https://github.com/liurida/gorm-development-skill/archive/main.zip#gorm-error-handling

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 471,000+ vetted skills library on demand.