apierror

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package API Error representation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError added in v0.8.2

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

APIError is the error representation for the API.

func Error

func Error(code int, err error) *APIError

Error creates a new API error from the code and error.

func New

func New(code int, msg string, args ...interface{}) *APIError

New creates a API error from the code, msg and extra arguments.

func (*APIError) Error added in v0.8.2

func (a *APIError) Error() string

Error returns the API error message.

func (*APIError) GetModel added in v0.8.2

func (a *APIError) GetModel() *models.Error

GetModel returns model error.

func (*APIError) WriteResponse added in v0.8.2

func (a *APIError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client.

Jump to

Keyboard shortcuts

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