errors

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_DEPLOY_NAMESPACE_MISMATCH_ERROR    = "MSG_DEPLOY_NAMESPACE_MISMATCH_ERROR"
	MSG_DEPLOY_EMPTY_NAMESPACE_ERROR       = "MSG_DEPLOY_EMPTY_NAMESPACE_ERROR"
	MSG_LOGIN_UNAUTHORIZED_ERROR           = "MSG_LOGIN_UNAUTHORIZED_ERROR"
	MSG_ENCRYPTION_KEY_CHANGED             = "MSG_ENCRYPTION_KEY_CHANGED"
	MSG_DASHBOARD_EXCLUSIVE_RESOURCE_ERROR = "MSG_DASHBOARD_EXCLUSIVE_RESOURCE_ERROR"
	MSG_TOKEN_EXPIRED_ERROR                = "MSG_TOKEN_EXPIRED_ERROR"
)

Errors that can be used directly without localizing

Variables

NonCriticalErrors is an array of error statuses, that are non-critical. That means, that this error can be silenced and displayed to the user as a warning on the frontend side.

Functions

func AppendError

func AppendError(err error, nonCriticalErrors []error) ([]error, error)

AppendError handles single error, that occurred during API GET call. If it is not critical, then it will be returned as a part of error array. Otherwise, it will be returned as a second value. Usage of this functions allows to distinguish critical errors from non-critical ones. It is needed to handle them in a different way.

func HandleError

func HandleError(err error) ([]error, error)

HandleError handles single error, that occurred during API GET call. If it is not critical, then it will be returned as a part of error array. Otherwise, it will be returned as a second value. Usage of this functions allows to distinguish critical errors from non-critical ones. It is needed to handle them in a different way.

func LocalizeError

func LocalizeError(err error) error

LocalizeError returns error code (string) that can be used by frontend to localize error message.

func MergeErrors

func MergeErrors(errorArraysToMerge ...[]error) (mergedErrors []error)

MergeErrors merges multiple non-critical error arrays into one array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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