streamerror

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// Reason is the stream error reason type.
	Reason Reason

	// Err contains the actual error that originated the stream error.
	Err error

	// Lang is the error text lang code.
	// If none assigned 'en' would be considered by default.
	Lang string

	// Text is the error descriptive text.
	Text string

	// ApplicationElement defines the application specific condition element.
	ApplicationElement stravaganza.Element
}

Error represents a stream "error" element.

func E

func E(reason Reason) *Error

E builds an stream error value from its arguments.

func (*Error) Element

func (se *Error) Element() stravaganza.Element

Element returns stream error XML node.

func (*Error) Error

func (se *Error) Error() string

Error satisfies error interface.

type Reason

type Reason uint8

Reason is the class of the stream error.

const (
	InvalidXML             Reason = iota // Invalid XML.
	InvalidNamespace                     // Invalid namespace.
	HostUnknown                          // Host unknown.
	InvalidFrom                          // Invalid from address.
	PolicyViolation                      // Policy violation.
	RemoteConnectionFailed               // Remote connection failed.
	Conflict                             // Conflict.
	ConnectionTimeout                    // Connection timeout.
	UnsupportedStanzaType                // Unsupported stanza type.
	UnsupportedVersion                   // Unsupported version.
	NotAuthorized                        // Not authorized.
	ResourceConstraint                   // Resource constraint.
	SystemShutdown                       // System shutdown.
	UndefinedCondition                   // Undefined condition.
	InternalServerError                  // Internal server error.
)

func (Reason) String

func (r Reason) String() string

String returns string error reason representation.

Jump to

Keyboard shortcuts

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