apperror

package
v0.0.0-...-94c8c1a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorType

type ErrorType string

ErrorType must not modified

func (ErrorType) Code

func (u ErrorType) Code() string

Code return the only code

func (ErrorType) Error

func (u ErrorType) Error() string

Error return the only message

func (ErrorType) String

func (u ErrorType) String() string

String return the error as it is

func (ErrorType) Var

func (u ErrorType) Var(params ...any) ErrorType

Var add generic variable value to the error message for example you have UserNotFoundError ErrorType = "ER1092 User with name %s is not found" Then you can insert the name UserNotFoundError.Var("mirza") --> "User with name mirza is not found"

Jump to

Keyboard shortcuts

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