errors

package
v0.0.0-...-8ee006d Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusBadParameter  = "Bad Parameter"
	StatusUnknown       = "Unknown"
	StatusIncorrectXml  = "Incorrect XML"
	StatusIncorrectJson = "Incorrect json"
	StatusNotUnique     = "Not Unique"
	NodeNotFound        = "Node not found"
	StatusForbidden     = "Forbidden"
)

Variables

View Source
var (
	NotLoggedMessage   = errors.New("You are currently not logged in to the system, to get proper access create a new user or login with an existing user.")
	LoginErrorMessage  = errors.New("Incorrect login or password")
	LogoutErrorMessage = errors.New("Some problems with logout")
	UnknownMessage     = errors.New("Oops, error occurred: Please provide bug to github: https://github.com/lastbackend/monarch/issues")
)

Functions

func New

func New(text string) *err

Types

type Err

type Err struct {
	Code string
	Attr string
	// contains filtered or unexported fields
}

func BadParameter

func BadParameter(attr string, e ...error) *Err

func Forbidden

func Forbidden(e ...error) *Err

func IncorrectJSON

func IncorrectJSON(e ...error) *Err

func IncorrectXML

func IncorrectXML(e ...error) *Err

func Unknown

func Unknown(e ...error) *Err

func (*Err) Err

func (e *Err) Err() error

func (*Err) Http

func (e *Err) Http(w http.ResponseWriter)

type Http

type Http struct {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Message string `json:"message"`
}
var HTTP Http

func (Http) BadRequest

func (Http) BadRequest(w http.ResponseWriter)

func (Http) InternalServerError

func (Http) InternalServerError(w http.ResponseWriter)

func (Http) InvalidJSON

func (Http) InvalidJSON(w http.ResponseWriter)

func (Http) InvalidXML

func (Http) InvalidXML(w http.ResponseWriter)

func (Http) NotFound

func (Http) NotFound(w http.ResponseWriter)

func (Http) NotImplemented

func (Http) NotImplemented(w http.ResponseWriter)

func (Http) Unauthorized

func (Http) Unauthorized(w http.ResponseWriter)

Jump to

Keyboard shortcuts

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