errors

package
v0.0.0-...-a7a9960 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2015 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFound = Error{
		Err: errors.New("Object not found"),
	}
)

Functions

func New

func New(err error) error

func NewValidation

func NewValidation(code ValidationCode, err error) error

Types

type Error

type Error struct {
	Err  error
	File string
	Line int
}

func (Error) Error

func (e Error) Error() string

type Validation

type Validation struct {
	Err  error
	Code ValidationCode
}

func (Validation) Error

func (v Validation) Error() string

type ValidationCode

type ValidationCode string
const (
	ValidationCodeAuthenticationError   ValidationCode = "authentication-error"
	ValidationCodeInvalidDate           ValidationCode = "invalid-date"
	ValidationCodeInvalidDuration       ValidationCode = "invalid-duration"
	ValidationCodeInvalidEmail          ValidationCode = "invalid-email"
	ValidationCodeInvalidEnrollmentType ValidationCode = "invalid-enrollment-type"
	ValidationCodeInvalidGroupType      ValidationCode = "invalid-group-type"
	ValidationCodeInvalidTime           ValidationCode = "invalid-time"
	ValidationCodeInvalidWeekday        ValidationCode = "invalid-weekday"
	ValidationCodeSessionExpired        ValidationCode = "session-expired" // TODO: Remove this from the core?
	ValidationCodeSunday                ValidationCode = "sunday"          // TODO: Remove this from the core?
	ValidationCodeMonday                ValidationCode = "monday"          // TODO: Remove this from the core?
	ValidationCodeTuesday               ValidationCode = "tuesday"         // TODO: Remove this from the core?
	ValidationCodeWednesday             ValidationCode = "wednesday"       // TODO: Remove this from the core?
	ValidationCodeThursday              ValidationCode = "thursday"        // TODO: Remove this from the core?
	ValidationCodeFriday                ValidationCode = "friday"          // TODO: Remove this from the core?
	ValidationCodeSaturday              ValidationCode = "saturday"        // TODO: Remove this from the core?
)

Jump to

Keyboard shortcuts

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