errors

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskError

type TaskError interface {
	// IsRecoverable reports if this task error is safe to retry.
	IsRecoverable() bool
	// Unwrap returns the underneath errors which cause the task error.
	Unwrap() []error
	// Message returns the detailed task-specific error message.
	Message() string
	// Error returns this error as string
	Error() string
}

func NewError

func NewError(typ Type, err ...error) TaskError

type Type

type Type int
const (
	// GetRoomInfo means failed to read live room information
	GetRoomInfo Type = iota
	// GetLiveInfo means failed to get live information
	GetLiveInfo
	// StreamCopy means an error occurred while reading stream video data
	StreamCopy
	// LiveEnded means the live is ended
	LiveEnded
	// DanmakuServerConnection means failed to connect to danmaku server, which provides danmaku and other control data
	DanmakuServerConnection
	// Heartbeat means an error occurred while sending heartbeat message, which may indicate a broken network connection
	Heartbeat
	// InitialLiveStatus means failed to get the live status for the first time, which happens in the early stage
	InitialLiveStatus
	// DanmakuExchangeRead means an error occurred while reading danmaku datagram from the server,
	// which may indicate a broken network connection
	DanmakuExchangeRead
	// GetDanmakuServerInfo means failed to get danmaku server info
	GetDanmakuServerInfo
	// RecoverLiveStatusChecker means failed to restart live status checker
	RecoverLiveStatusChecker

	// FileCreation means failed to create a file
	FileCreation
	// InvalidLiveInfo means the live info is insufficient for recording
	InvalidLiveInfo
	// LiveStatusWatch means the live status watcher encountered an unrecoverable error
	LiveStatusWatch
	// Unknown means the error type is unexpected and is not suitable to retry for safety
	Unknown
	// InvalidAuthProtocol means authentication failed because the protocol is invalid,
	// which may indicate the protocol implementation is outdated
	InvalidAuthProtocol
	// MessageDecompression means the message cannot be decompressed, and we cannot understand its content
	MessageDecompression
	// JsonDecode means we cannot decode a datum which is expected to be a JSON object string
	JsonDecode
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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