File: errors.go

package info (click to toggle)
golang-github-pion-turn.v2 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, forky, sid, trixie
  • size: 716 kB
  • sloc: makefile: 4
file content (37 lines) | stat: -rw-r--r-- 1,193 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package client

import (
	"errors"
)

var (
	errFake                                = errors.New("fake error")
	errTryAgain                            = errors.New("try again")
	errClosed                              = errors.New("use of closed network connection")
	errUDPAddrCast                         = errors.New("addr is not a net.UDPAddr")
	errAlreadyClosed                       = errors.New("already closed")
	errDoubleLock                          = errors.New("try-lock is already locked")
	errTransactionClosed                   = errors.New("transaction closed")
	errWaitForResultOnNonResultTransaction = errors.New("WaitForResult called on non-result transaction")
	errFailedToBuildRefreshRequest         = errors.New("failed to build refresh request")
	errFailedToRefreshAllocation           = errors.New("failed to refresh allocation")
	errFailedToGetLifetime                 = errors.New("failed to get lifetime from refresh response")
)

type timeoutError struct {
	msg string
}

func newTimeoutError(msg string) error {
	return &timeoutError{
		msg: msg,
	}
}

func (e *timeoutError) Error() string {
	return e.msg
}

func (e *timeoutError) Timeout() bool {
	return true
}