errors

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package errors provides database error utilities and translation to gokit AppError types for consistent error handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromDatabase

func FromDatabase(err error, resource string) *apperrors.AppError

FromDatabase converts a database error to an AppError. It translates GORM and database-specific errors to user-friendly messages.

func IsConnectionError

func IsConnectionError(err error) bool

IsConnectionError checks if a database error is a connection error that might be resolved by retrying.

func IsDuplicateError

func IsDuplicateError(err error) bool

IsDuplicateError checks if the error is a GORM duplicate-key violation.

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError checks if the error is a GORM record-not-found error.

func IsRetryableError

func IsRetryableError(err error) bool

IsRetryableError determines if a database error should trigger a retry.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL