Don't allocate new error inside TaskLoop

Libraries use errors.Is to catch this error. Allocating a new one inside
internal breaks that
This commit is contained in:
Sean DuBois
2024-07-25 11:18:50 -04:00
parent f15ba9868c
commit abf50f9c34
2 changed files with 10 additions and 6 deletions

View File

@@ -3,7 +3,11 @@
package ice
import "errors"
import (
"errors"
"github.com/pion/ice/v3/internal/taskloop"
)
var (
// ErrUnknownType indicates an error with Unknown info.
@@ -36,7 +40,7 @@ var (
ErrProtoType = errors.New("invalid transport protocol type")
// ErrClosed indicates the agent is closed
ErrClosed = errors.New("the agent is closed")
ErrClosed = taskloop.ErrClosed
// ErrNoCandidatePairs indicates agent does not have a valid candidate pair
ErrNoCandidatePairs = errors.New("no candidate pairs available")