1 Star 1 Fork 0

raininfall/RTSP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
error.go 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
Songrq 提交于 2019-10-24 14:59 . 2019年10月24日 14:59:30
package rtsp
import "errors"
// const errors
var (
ErrorInterleavedFrameHeaderTooShort = errors.New("interleave frame too short")
ErrorInterleavedMagicNumberWrong = errors.New("interleaved magic number wrong")
ErrorClientAlreadyStopped = errors.New("RTSP client already stopped")
ErrorTimeout = errors.New("Timeout")
ErrorUserinfoNeed = errors.New("Need user info to login")
ErrorRTPTooShort = errors.New("RTP packet is too short")
ErrorDropFrame = errors.New("drop frame due to full queue")
ErrorNotImplement = errors.New("not implement")
ErrorQueueFull = errors.New("drop data due to queue full")
)
// StatusError for response
type StatusError struct {
statusCode int
body string
}
// NewStatusError of RTSP
func NewStatusError(statusCode int, body string) error {
return &StatusError{
statusCode: statusCode,
body: body,
}
}
func (se StatusError) Error() string {
if len(se.body) > 0 {
return se.body
}
if statusText, ok := statusText[se.statusCode]; ok {
return statusText
}
return "Unknown"
}
type badStringError struct {
Msg string
Line string
}
func (e *badStringError) Error() string {
return e.Msg + " " + e.Line
}
type missingError struct {
Part string
}
func (e *missingError) Error() string {
return "Missing " + e.Part
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/raininfall/rtsp.git
git@gitee.com:raininfall/rtsp.git
raininfall
rtsp
RTSP
master

搜索帮助