...

Package errors

import "scheduler/errors"
Overview
Index

Overview ▾

Package errors implements all the errors catalog available.

Constants

const (
    GenericError                int = 1
    DBError                     int = 2
    GenericNotFoundError        int = 3
    InputNotValid               int = 4
    FaasConnectError            int = 5
    MarshalError                int = 6
    ServiceNotValid             int = 100
    GenericDeployError          int = 200
    GenericOpenFaasError        int = 300
    JobCannotBeScheduledError   int = 400
    JobDeliberatelyRejected     int = 401
    CannotRetrieveAction        int = 402
    JobCouldNotBeForwarded      int = 403
    PeerResponseNil             int = 404
    CannotRetrieveRecipientNode int = 405

    DBDuplicateKey int = 11000
)

func GetErrorJson

func GetErrorJson(errorCode int) (int, string, error)

func GetErrorJsonMessage

func GetErrorJsonMessage(errorCode int, msg string) (int, string, error)

func ReplyWithError

func ReplyWithError(w *http.ResponseWriter, errorCode int, customHeaders *map[string]string)

func ReplyWithErrorMessage

func ReplyWithErrorMessage(w *http.ResponseWriter, errorCode int, msg string, customHeaders *map[string]string)

type ErrorAPIGet

type ErrorAPIGet struct {
    URL string
}

func (ErrorAPIGet) Error

func (e ErrorAPIGet) Error() string

type ErrorAPIPost

type ErrorAPIPost struct {
    URL string
}

func (ErrorAPIPost) Error

func (e ErrorAPIPost) Error() string

type ErrorJSONDecoding

type ErrorJSONDecoding struct{}

func (ErrorJSONDecoding) Error

func (e ErrorJSONDecoding) Error() string

type ErrorJSONEncode

type ErrorJSONEncode struct{}

func (ErrorJSONEncode) Error

func (e ErrorJSONEncode) Error() string

type ErrorReply

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