gohtypes

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: MIT Imports: 2 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Panic

func Panic(message string, code int)

Panic wraps a panic call propagating the given error parameter

func PanicIfError

func PanicIfError(message string, code int, err error)

PanicIfError is just a wrapper to a panic call that propagates a custom Error when the err property != nil

Types

type Error

type Error struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
	Err     error  `json:"err"`
}

Error groups together information that defines an error. Should always be used to

func (*Error) Error

func (e *Error) Error() string

Error() gives a string representing the error; also, forces the Error type to comply with the error interface If the RUNTIME_MODE variable is defined and has the value DEBUG, more information is emitted to the final error message

func (*Error) InnerError

func (e *Error) InnerError() string

InnerError gives a string with the details of an inner error, if it exists

Jump to

Keyboard shortcuts

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