errors

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsKind added in v0.4.0

func IsKind[K Kind](err error) (K, bool)

IsKind is a shorthand to check if an error is of kind K.

Types

type Cancellation

type Cancellation struct{}

Cancellation errors indicate that the operation was canceled.

func (Cancellation) String added in v0.4.0

func (Cancellation) String() string

type Client added in v0.4.0

type Client struct {
	Message string
	Kind    Kind
	Nested  error
	Shallow bool
}

Client represents a purely client-side error.

func (*Client) Attrs added in v0.4.0

func (e *Client) Attrs() []slog.Attr

func (*Client) Error added in v0.4.0

func (e *Client) Error() string

func (*Client) Unwrap added in v0.4.0

func (e *Client) Unwrap() error

type ConfigurationInvalid

type ConfigurationInvalid struct {
	PropertyName  string
	PropertyValue any
}

ConfigurationInvalid errors indicate that a provided configuration value or argument is invalid.

func (ConfigurationInvalid) Attrs added in v0.4.0

func (e ConfigurationInvalid) Attrs() []slog.Attr

func (ConfigurationInvalid) String added in v0.4.0

func (ConfigurationInvalid) String() string

type ExecutionError added in v0.4.0

type ExecutionError struct{}

ExecutionError errors indicate that the command processor encountered an error while executing the command.

func (ExecutionError) String added in v0.4.0

func (ExecutionError) String() string

type HeaderInvalid

type HeaderInvalid struct {
	HeaderName  string
	HeaderValue string
}

HeaderInvalid errors indicate that an MQTT header property is has an invalid value in the received message.

func (HeaderInvalid) Attrs added in v0.4.0

func (e HeaderInvalid) Attrs() []slog.Attr

func (HeaderInvalid) String added in v0.4.0

func (HeaderInvalid) String() string

type HeaderMissing

type HeaderMissing struct {
	HeaderName string
}

HeaderMissing errors indicate that a required MQTT header property is missing from the received message.

func (HeaderMissing) Attrs added in v0.4.0

func (e HeaderMissing) Attrs() []slog.Attr

func (HeaderMissing) String added in v0.4.0

func (HeaderMissing) String() string

type InternalLogicError

type InternalLogicError struct {
	// Deprecated: Only for wire protocol compat.
	PropertyName string
}

InternalLogicError errors indicate that the client or service observed a condition that was thought to be impossible.

func (InternalLogicError) String added in v0.4.0

func (InternalLogicError) String() string

type Kind

type Kind interface {
	String() string
	// contains filtered or unexported methods
}

Kind defines the type of protocol error being thrown.

type MqttError

type MqttError struct{}

MqttError errors indicate that the MQTT communication encountered an error and failed.

func (MqttError) String added in v0.4.0

func (MqttError) String() string

type PayloadInvalid

type PayloadInvalid struct{}

PayloadInvalid errors indicate that the MQTT payload cannot be serialized/deserialized.

func (PayloadInvalid) String added in v0.4.0

func (PayloadInvalid) String() string

type Remote added in v0.4.0

type Remote struct {
	Message string
	Kind    Kind
}

Remote represents an error that is sent between services over the wire.

func (*Remote) Attrs added in v0.4.0

func (e *Remote) Attrs() []slog.Attr

func (*Remote) Error added in v0.4.0

func (e *Remote) Error() string

type StateInvalid

type StateInvalid struct {
	PropertyName string
}

StateInvalid errors indicate that the current program state is invalid relative to the method that was called.

func (StateInvalid) Attrs added in v0.4.0

func (e StateInvalid) Attrs() []slog.Attr

func (StateInvalid) String added in v0.4.0

func (StateInvalid) String() string

type Timeout

type Timeout struct {
	TimeoutName  string
	TimeoutValue time.Duration
}

Timeout errors indicate that the operation was aborted due to timeout.

func (Timeout) Attrs added in v0.4.0

func (e Timeout) Attrs() []slog.Attr

func (Timeout) String added in v0.4.0

func (Timeout) String() string

type UnknownError

type UnknownError struct {
	// Deprecated: Only for schemaregistry compat.
	PropertyName string
	// Deprecated: Only for schemaregistry compat.
	PropertyValue any
}

UnknownError errors indicate that the client or service received an unexpected error from a dependent component.

func (UnknownError) String added in v0.4.0

func (UnknownError) String() string

type UnsupportedVersion added in v0.4.0

type UnsupportedVersion struct {
	ProtocolVersion                string
	SupportedMajorProtocolVersions []int
}

UnsupportedVersion errors indicate that the command processor or receiver doesn't support the provided protocol version.

func (UnsupportedVersion) Attrs added in v0.4.0

func (e UnsupportedVersion) Attrs() []slog.Attr

func (UnsupportedVersion) String added in v0.4.0

func (UnsupportedVersion) String() string

Jump to

Keyboard shortcuts

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