errors

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 2 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

This section is empty.

Types

type Error

type Error struct {
	Message string
	Kind    Kind

	NestedError error

	HeaderName  string
	HeaderValue string

	TimeoutName  string
	TimeoutValue time.Duration

	PropertyName  string
	PropertyValue any

	ProtocolVersion                string
	SupportedMajorProtocolVersions []int

	InApplication  bool
	IsShallow      bool
	IsRemote       bool
	HTTPStatusCode int
}

Error represents a structured protocol error.

func (*Error) Attrs added in v0.2.0

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

Attrs returns additional error attributes for slog.

func (*Error) Error

func (e *Error) Error() string

Error returns the error as a string.

type Kind

type Kind int

Kind defines the type of error being thrown.

const (
	HeaderMissing Kind = iota
	HeaderInvalid
	PayloadInvalid
	Timeout
	Cancellation
	ConfigurationInvalid
	ArgumentInvalid
	StateInvalid
	InternalLogicError
	UnknownError
	InvocationException
	ExecutionException
	MqttError
	UnsupportedRequestVersion
	UnsupportedResponseVersion
)

The following are the defined error kinds.

Jump to

Keyboard shortcuts

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