move errors into subpackage

This commit is contained in:
aler9
2021-03-21 11:19:35 +01:00
parent c0e045071b
commit 437b4cc87e
8 changed files with 391 additions and 354 deletions

View File

@@ -8,6 +8,7 @@ import (
psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/base"
"github.com/aler9/gortsplib/pkg/liberrors"
)
// Announce writes an ANNOUNCE request and reads a Response.
@@ -43,7 +44,8 @@ func (c *ClientConn) Announce(u *base.URL, tracks Tracks) (*base.Response, error
}
if res.StatusCode != base.StatusOK {
return nil, ErrClientWrongStatusCode{res.StatusCode, res.StatusMessage}
return nil, liberrors.ErrClientWrongStatusCode{
Code: res.StatusCode, Message: res.StatusMessage}
}
c.streamURL = u
@@ -71,7 +73,8 @@ func (c *ClientConn) Record() (*base.Response, error) {
}
if res.StatusCode != base.StatusOK {
return nil, ErrClientWrongStatusCode{res.StatusCode, res.StatusMessage}
return nil, liberrors.ErrClientWrongStatusCode{
Code: res.StatusCode, Message: res.StatusMessage}
}
c.state = clientConnStateRecord