errors

package
v0.0.0-...-3a1d33f Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errors is an interface for defining detailed errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(id, detail string) error

func Forbidden

func Forbidden(id, detail string) error

func InternalServerError

func InternalServerError(id, detail string) error

func New

func New(id, detail string, code int32) error

func NotFound

func NotFound(id, detail string) error

func Unauthorized

func Unauthorized(id, detail string) error

Types

type Error

type Error struct {
	Id     string `json:"id"`
	Code   int32  `json:"code"`
	Detail string `json:"detail"`
	Status string `json:"status"`
}

Errors provide a way to return detailed information for an RPC request error. The error is normally JSON encoded.

func Parse

func Parse(err string) *Error

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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