lderrors

package
v3.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package lderrors provides identifiers for particular kinds of errors that can be returned by code in github.com/launchdarkly/go-sdk-common/v3/ldcontext or github.com/launchdarkly/go-sdk-common/v3/ldattr.

Errors are only defined here if they are specifically generated by those packages. The LaunchDarkly Go SDK (github.com/launchdarkly/go-server-sdk/v6) may define its own error values for additional error conditions that are related to higher-level SDK functionality.

Unlike some packages which define errors as exported global variables, here they are exported as types only. This allows consistent usage regardless of whether a particular kind of error has properties that can vary, or is a singleton with no properties. So, for instance, rather than doing an equality test like this--

if err == lderrors.ErrContextKeyEmpty

--do a type check:

if _, ok := err.(lderrors.ErrContextKeyEmpty); ok

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrAttributeEmpty

type ErrAttributeEmpty struct{}

ErrAttributeEmpty means that you tried to use an uninitialized ldattr.Ref{}, or one that was initialized from an empty string, or from a string that consisted only of a slash.

For details of the attribute reference syntax, see ldattr.Ref.

func (ErrAttributeEmpty) Error

func (e ErrAttributeEmpty) Error() string

type ErrAttributeExtraSlash

type ErrAttributeExtraSlash struct{}

ErrAttributeExtraSlash means that an attribute reference contained a double slash or trailing slash causing one path component to be empty, such as "/a//b" or "/a/b/".

For details of the attribute reference syntax, see ldattr.Ref.

func (ErrAttributeExtraSlash) Error

func (e ErrAttributeExtraSlash) Error() string

type ErrAttributeInvalidEscape

type ErrAttributeInvalidEscape struct{}

ErrAttributeInvalidEscape means that an attribute reference contained contained a "~" character that was not followed by "0" or "1".

For details of the attribute reference syntax, see ldattr.Ref.

func (ErrAttributeInvalidEscape) Error

type ErrContextKeyEmpty

type ErrContextKeyEmpty struct{}

ErrContextKeyEmpty means that the ldcontext.Context Key field was set to an empty string.

func (ErrContextKeyEmpty) Error

func (e ErrContextKeyEmpty) Error() string

type ErrContextKeyMissing

type ErrContextKeyMissing struct{}

ErrContextKeyMissing means that the JSON representation of an ldcontext.Context had no "key" property.

func (ErrContextKeyMissing) Error

func (e ErrContextKeyMissing) Error() string

type ErrContextKeyNull

type ErrContextKeyNull struct{}

ErrContextKeyNull means that the "key" property in the JSON representation of an ldcontext.Context had a null value. This is specific to JSON unmarshaling, since there is no way to specify a null value for this field programmatically.

func (ErrContextKeyNull) Error

func (e ErrContextKeyNull) Error() string

type ErrContextKindCannotBeKind

type ErrContextKindCannotBeKind struct{}

ErrContextKindCannotBeKind means that you have tried to set the ldcontext.Context Kind field to the string "kind". The Context schema does not allow this.

func (ErrContextKindCannotBeKind) Error

type ErrContextKindEmpty

type ErrContextKindEmpty struct{}

ErrContextKindEmpty means that the "kind" property in the JSON representation of an ldcontext.Context had an empty string value. This is specific to JSON unmarshaling, since if you are creating a Context programmatically, an empty string is automatically changed to ldcontext.DefaultKind.

func (ErrContextKindEmpty) Error

func (e ErrContextKindEmpty) Error() string

type ErrContextKindInvalidChars

type ErrContextKindInvalidChars struct{}

ErrContextKindInvalidChars means that you have tried to set the ldcontext.Context Kind field to a string that contained disallowed characters.

func (ErrContextKindInvalidChars) Error

type ErrContextKindMultiDuplicates

type ErrContextKindMultiDuplicates struct{}

ErrContextKindMultiDuplicates means that you have used an ldcontext constructor or builder for a multi-context and you specified more than one individual Context in it with the same kind.

func (ErrContextKindMultiDuplicates) Error

type ErrContextKindMultiForSingleKind

type ErrContextKindMultiForSingleKind struct{}

ErrContextKindMultiForSingleKind means that you have tried to set the ldcontext.Context Kind field to the string "multi" for a single context. The Context schema does not allow this.

func (ErrContextKindMultiForSingleKind) Error

type ErrContextKindMultiWithNoKinds

type ErrContextKindMultiWithNoKinds struct{}

ErrContextKindMultiWithNoKinds means that you have used an ldcontext constructor or builder for a multi-context but you did not specify any individual Contexts in it.

func (ErrContextKindMultiWithNoKinds) Error

type ErrContextPerKindErrors

type ErrContextPerKindErrors struct {
	// Errors is a map where each key is the context kind (as a string) and the value is the
	// validation error for that kind.
	Errors map[string]error
}

ErrContextPerKindErrors means that a multi-context contained at least one kind where the individual Context was invalid. There may be a separate validation error for each kind.

func (ErrContextPerKindErrors) Error

func (e ErrContextPerKindErrors) Error() string

type ErrContextUninitialized

type ErrContextUninitialized struct{}

ErrContextUninitialized means that you have tried to use an empty ldcontext.Context{} struct.

func (ErrContextUninitialized) Error

func (e ErrContextUninitialized) Error() string

Jump to

Keyboard shortcuts

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