summaryrefslogtreecommitdiff
path: root/vendor/github.com/pion/turn/v2/internal/client/errors.go
blob: 2d4bd30c419690b5221afa036a02d796b40353ca (plain)
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 (
	errFakeErr                             = 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
}