-
Notifications
You must be signed in to change notification settings - Fork 86
/
error.go
44 lines (35 loc) · 940 Bytes
/
error.go
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
//
// Copyright (c) 2018- yutopp ([email protected])
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
//
package rtmp
import (
"fmt"
"github.com/pkg/errors"
"github.com/yutopp/go-rtmp/message"
)
var ErrClosed = errors.New("Server is closed")
type ConnectRejectedError struct {
TransactionID int64
Result *message.NetConnectionConnectResult
}
func (err *ConnectRejectedError) Error() string {
return fmt.Sprintf(
"Connect is rejected: TransactionID = %d, Result = %#v",
err.TransactionID,
err.Result,
)
}
type CreateStreamRejectedError struct {
TransactionID int64
Result *message.NetConnectionCreateStreamResult
}
func (err *CreateStreamRejectedError) Error() string {
return fmt.Sprintf(
"CreateStream is rejected: TransactionID = %d, Result = %#v",
err.TransactionID,
err.Result,
)
}