Source File
errors.go
Belonging Package
github.com/pion/stun
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage stunimport// DecodeErr records an error and place when it is occurred.////nolint:errnametype DecodeErr struct {Place DecodeErrPlaceMessage string}// IsInvalidCookie returns true if error means that magic cookie// value is invalid.func ( DecodeErr) () bool {return .Place == DecodeErrPlace{"message", "cookie"}}// IsPlaceParent reports if error place parent is p.func ( DecodeErr) ( string) bool {return .Place.Parent ==}// IsPlaceChildren reports if error place children is c.func ( DecodeErr) ( string) bool {return .Place.Children ==}// IsPlace reports if error place is p.func ( DecodeErr) ( DecodeErrPlace) bool {return .Place ==}// DecodeErrPlace records a place where error is occurred.type DecodeErrPlace struct {Parent stringChildren string}func ( DecodeErrPlace) () string {return .Parent + "/" + .Children}func ( DecodeErr) () string {return "BadFormat for " + .Place.String() + ": " + .Message}func newDecodeErr(, , string) *DecodeErr {return &DecodeErr{Place: DecodeErrPlace{Parent: , Children: },Message: ,}}func newAttrDecodeErr(, string) *DecodeErr {return newDecodeErr("attribute", , )}// ErrAttributeSizeInvalid means that decoded attribute size is invalid.var ErrAttributeSizeInvalid = errors.New("attribute size is invalid")// ErrAttributeSizeOverflow means that decoded attribute size is too big.var ErrAttributeSizeOverflow = errors.New("attribute size overflow")
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |