errors

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrISCPはiscpライブラリで定義されている基底エラーです。
	ErrISCP = errors.New("iscp")

	// トランスポート関連のエラー
	// ErrConnectionClosedは、トランスポートが閉じられている状態でトランスポートへの読み書きをした場合のエラーです。
	ErrConnectionClosed = fmt.Errorf("closed iscp connection: %w", ErrISCP)

	ErrConnectionClose = fmt.Errorf("closed iscp connection: %w", ErrISCP)
	// ErrConnectionNormalCloseは、トランスポートが正常な状態で閉じられたエラーです。
	ErrConnectionNormalClose = fmt.Errorf("normal: %w", ErrConnectionClose)
	// ErrConnectionAbnormalCloseは、トランスポートが異常な状態で閉じられたエラーです。
	ErrConnectionAbnormalClose = fmt.Errorf("abnormal: %w", ErrConnectionClose)
	// ErrConnectionGoingAwayClose は、トランスポートが going away 状態で閉じられたエラーです。
	ErrConnectionGoingAwayClose = fmt.Errorf("going away: %w", ErrConnectionClose)
	// ErrConnectionInternalErrorClose は、トランスポートが内部エラーにより閉じられたエラーです。
	ErrConnectionInternalErrorClose = fmt.Errorf("internal error: %w", ErrConnectionClose)

	// ErrStreamClosedは、ストリームが閉じられている状態でトランスポートへの読み書きをした場合のエラーです。
	ErrStreamClosed = fmt.Errorf("closed iscp stream: %w", ErrISCP)
	// ErrMalformedMessage、メッセージのエンコードやデコードに失敗した時のエラーです。
	ErrMalformedMessage = fmt.Errorf("malformed message: %w", ErrISCP)
	// ErrMessageTooLargeは、メッセージが大きすぎる場合のエラーです。
	ErrMessageTooLarge = fmt.Errorf("message is too large: %w", ErrMalformedMessage)
)
View Source
var Join = errors.Join

Functions

func As

func As(err error, target any) bool

func Errorf

func Errorf(format string, a ...any) error

func Is

func Is(err, target error) bool

func New

func New(text string) error

Types

type FailedMessageError

type FailedMessageError struct {
	ResultCode      message.ResultCode // 結果コード
	ResultString    string             // 結果文字列
	ReceivedMessage message.Message    // 受信メッセージ
}

iSCPでの通信中に、失敗を意味する結果コードが含まれたメッセージを受信した場合に送出される例外です。

func AsFailedMessageError

func AsFailedMessageError(err error) (*FailedMessageError, bool)

func (FailedMessageError) Error

func (e FailedMessageError) Error() string

func (FailedMessageError) Is

func (e FailedMessageError) Is(err error) bool

Jump to

Keyboard shortcuts

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