error

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int
const (
	NoError ErrorCode = iota
	UnknownError
	BadInputParameterError
	MissingInputParameterError
	SourceConnectionError
)

type ErrorResult

type ErrorResult struct {
	ErrorMessage string
	ErrorCode    ErrorCode
}

ErrorResult represents an error returned by an API call.

func CreateBadInputParameterError

func CreateBadInputParameterError(parameter, value, explanation string) *ErrorResult

CreateBadInputParameterError is a helper method to create a consistent error result across plugins when an input parameter has an unexpected format.

func CreateMissingInputParameterError

func CreateMissingInputParameterError(parameter string) *ErrorResult

CreateMissingInputParameterError is a helper method to create a consistent error result across plugins when a mandatory parameter is missing.

func CreateSourceConnectionError

func CreateSourceConnectionError(url, message string) *ErrorResult

CreateSourceConnectionError is a helper method to create a consistent error result across plugins when there is a connection problem to the data source or identity store.

func ToErrorResult

func ToErrorResult(err error) *ErrorResult

ToErrorResult is a helper method to to create an ErrorResult from an error. If the error already is of type ErrorResult, the original is returned.

func (ErrorResult) Error

func (e ErrorResult) Error() string

Jump to

Keyboard shortcuts

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