utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ErrCodeDBInitFailed         = 1001
	ErrCodeDBSQLRetrievalFailed = 1002
)

Error codes

Variables

View Source
var ErrorDescriptions = map[int]string{
	ErrCodeDBInitFailed:         "Database initialization failed. Possible Causes: Incorrect connection string, network issues, or authentication failure.",
	ErrCodeDBSQLRetrievalFailed: "Failed to retrieve the underlying SQL DB object from the GORM DB instance. Possible Causes: Internal Gorm issues, improper initialization, driver problems",
}

ErrorDescriptions maps error codes to their descriptions

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Code        int
	Description string
	Message     string
	Err         error
}

AppError is a custom error type that includes an error code and a message

func WrappedError

func WrappedError(code int, message string, err error) *AppError

WrappedError creates a new AppError

func (*AppError) Error

func (e *AppError) Error() string

Error method returns the error message of AppError

Jump to

Keyboard shortcuts

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