Repository navigation
Expand file tree
/
Copy patherrors.go
More file actions
75 lines (61 loc) · 3.62 KB
/
Copy patherrors.go
File metadata and controls
75 lines (61 loc) · 3.62 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
package turn
import (
"errors"
"net"
"github.com/the-sarge/turn/v5/internal/client"
)
// ErrClosed is net.ErrClosed: errors.Is(err, ErrClosed) on any error from
// this package means the client or allocation is closed, or a wrapped cause
// was itself a socket close — never a synthetic stand-in for another failure.
var ErrClosed = net.ErrClosed
// ErrTransactionTimeout reports a STUN transaction whose retransmissions
// were all exhausted without an accepted server response. This includes
// transactions that received only responses rejected by method or integrity
// validation.
var ErrTransactionTimeout = client.ErrTransactionTimeout
// ErrAllocationRefreshFailed reports a terminal allocation-lifetime result:
// zero remaining lifetime, an exhausted refresh transaction, a well-formed
// non-438 error response, or stale-nonce retry exhaustion. Initial zero returns
// no Allocation; an existing allocation seals itself, wakes pending waiters,
// makes every subsequent operation return ErrClosed wrapped with this cause,
// and makes the caller's Close return it.
var ErrAllocationRefreshFailed = client.ErrAllocationRefreshFailed
// ErrPermissionRefreshFailed reports a permission refresh that kept failing
// after retries. Prepared peers terminalize with it: their writes fail
// rather than ever falling back to Send indications.
var ErrPermissionRefreshFailed = client.ErrPermissionRefreshFailed
// ErrChannelBindFailed reports a channel binding that could not be
// established or has failed for a prepared peer.
var ErrChannelBindFailed = client.ErrChannelBindFailed
// ErrChannelBindingExpired reports a confirmed channel binding whose
// server-side lifetime expired before the write.
var ErrChannelBindingExpired = client.ErrChannelBindingExpired
// ErrNotPrepared reports a WriteTo to a peer for which PreparePeer has not
// succeeded on this allocation. Nothing is sent: writes are ChannelData over
// a prepared binding or fail with zero network output.
var ErrNotPrepared = client.ErrNotPrepared
// ErrAlreadyAllocated is returned by Allocate when the client already owns a
// live allocation. Close that allocation before allocating again.
var ErrAlreadyAllocated = errors.New("turn: already allocated")
// ErrInvalidPeer reports a peer address outside the canonical netip.AddrPort
// domain: it must be unicast, unmapped or mappable by unmapping, zone-free,
// and carry a nonzero port.
var ErrInvalidPeer = errors.New("turn: invalid peer address")
// ErrInvalidRelayedAddress reports that the server's Allocate success carried
// a relayed transport address that cannot be canonicalized. The allocation is
// released with a lifetime-0 Refresh before Allocate returns this error.
var ErrInvalidRelayedAddress = errors.New("turn: server reported an invalid relayed address")
var (
errNilConn = errors.New("turn: conn cannot not be nil")
errInvalidServer = errors.New(
"turn: Server must be a canonical netip.AddrPort (unicast, unmapped, zone-free, nonzero port)")
errInvalidPermissionRefreshInterval = errors.New(
"turn: PermissionRefreshInterval must be zero or a positive duration less than 5 minutes")
errNilContext = errors.New("turn: context must not be nil")
errChannelBindNotFound = errors.New("turn: no binding found for channel")
errUnexpectedServerDatagram = errors.New("turn: datagram from server is neither STUN nor ChannelData")
errFailedToDecodeSTUN = errors.New("turn: failed to decode STUN message")
errUnexpectedSTUNRequestMessage = errors.New("turn: unexpected STUN request message")
)