Skip to content

xerr v1.1.0 – Modular production‑grade error system

Choose a tag to compare

@Ali127Dev Ali127Dev released this 26 Apr 18:26
· 17 commits to main since this release

Major redesign of the xerr package introducing a fully modular, enterprise‑grade
structured error handling system designed for Clean Architecture and microservices.

Key improvements:

  • Introduced strongly typed error codes with centralized HTTP status mapping.
  • Implemented a core Error type with private fields and safe JSON serialization.
  • Added functional option pattern (WithMessage, WithMeta, WithStatus, WithErr).
  • Implemented New() and Wrap() constructors for structured error creation.
  • Ensured compatibility with errors.Is / errors.As via proper Unwrap support.
  • Added SwaggerErrOutput model for stable OpenAPI documentation.
  • Prevented internal error leakage in API responses while preserving error chains.
  • Improved maintainability through clear separation of concerns.

New package structure:

  • doc.go → package documentation
  • code.go → error codes + HTTP status mapping
  • error.go → core error implementation
  • options.go → functional error options
  • wrap.go → constructors (New / Wrap)
  • swagger.go → swagger documentation model

This release establishes the foundation for consistent, observable,
and production‑ready error handling across Go services.

Full Changelog: v1.0.0...v1.1.0