...

Package errors

import "discovery/errors"
Overview
Index

Overview ▾

Package errors implements error management

Constants

const (
    GenericError         int = 1
    DBError              int = 2
    GenericNotFoundError int = 3
    InputNotValid        int = 4
    // configuration
    ConfigurationNotReady int = 100
    // mongo errors
    DBDuplicateKey int = 11000
)

func ReplyWithError

func ReplyWithError(w http.ResponseWriter, errorCode int)

func ReplyWithErrorMessage

func ReplyWithErrorMessage(w http.ResponseWriter, errorCode int, msg string)

type ErrorReply

type ErrorReply struct {
    Code    int    `json:"code,omitempty"`
    Message string `json:"message,omitempty"`
}