rerr: github.com/i-erokhin/rerr Index | Files

package rerr

import "github.com/i-erokhin/rerr"

Index

Package Files

error.go

Constants

const (
    EParse      = json2.E_PARSE
    EInvalidReq = json2.E_INVALID_REQ
    ENoMethod   = json2.E_NO_METHOD
    EBadParams  = json2.E_BAD_PARAMS
    EInternal   = json2.E_INTERNAL
    EServer     = json2.E_SERVER

    EUnauthorised   json2.ErrorCode = -32001
    EForbidden      json2.ErrorCode = -32002
    EDuplicate      json2.ErrorCode = -32003
    EBadCredentials json2.ErrorCode = -32004
    ENotFound       json2.ErrorCode = -32005
)

Variables

var Messages = map[json2.ErrorCode]string{
    EParse:      "Parse error",
    EInvalidReq: "Invalid Request",
    ENoMethod:   "Method not found",
    EBadParams:  "Invalid params",
    EInternal:   "Internal error",
    EServer:     "Server error",

    EUnauthorised:   "Unauthorized",
    EForbidden:      "Forbidden",
    EDuplicate:      "Duplicate value",
    EBadCredentials: "Bad credentials",
    ENotFound:       "Not found",
}

func New Uses

func New(code json2.ErrorCode, data interface{}) *json2.Error

type Code Uses

type Code int

Package rerr imports 1 packages (graph). Updated 2020-01-01. Refresh now. Tools for package owners.