error_code

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownError        = "ERR00000"
	InternalServerError = "ERR00001"
	InvalidRequest      = "ERR00002"
	Unauthorized        = "ERR00003"
	Forbidden           = "ERR00004"
	NotFound            = "ERR00005"
)

Standard error codes for the application.

Variables

This section is empty.

Functions

func GetErrorCode

func GetErrorCode(code string) string

GetErrorCode returns the canonical error code string. Returns UnknownError if the code is not recognized.

func GetErrorMessage

func GetErrorMessage(code string) string

GetErrorMessage returns the human-readable message for the given error code. Returns the input code as-is if not recognized (useful for custom error messages).

func GetHTTPStatusCode

func GetHTTPStatusCode(code string) int

GetHTTPStatusCode returns the HTTP status code for the given error code. Returns 500 if the code is not recognized.

Types

This section is empty.

Jump to

Keyboard shortcuts

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