internal

package
v0.0.0-...-80f9fc5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultErrorKind    = EINTERNAL
	DefaultErrorMessage = "Internal error"
	DefaultErrorCode    = "internal_error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error implements Error

func NewError

func NewError(kind ErrorKind, message, code string) *Error

func (*Error) Code

func (c *Error) Code() string

func (*Error) Error

func (c *Error) Error() string

func (*Error) Kind

func (c *Error) Kind() ErrorKind

type ErrorKind

type ErrorKind string
const (
	ENOTFOUND ErrorKind = "notfound"
	EINTERNAL ErrorKind = "internal"
	EBADINPUT ErrorKind = "badinput"
)

func ParseError

func ParseError(err error) (kind ErrorKind, message, code string)

ParseError parses err and hide internal level or implementation error. Any Error non-compatible will be ignored and returns EINTERNAL kind of error.

Jump to

Keyboard shortcuts

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