-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patherr.go
52 lines (44 loc) · 2.46 KB
/
err.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
45
46
47
48
49
50
51
52
// Copyright 2023-2024 antlabs. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package greatws
import "errors"
var (
// conn已经被关闭
ErrClosed = errors.New("closed")
ErrWrongStatusCode = errors.New("Wrong status code")
ErrUpgradeFieldValue = errors.New("The value of the upgrade field is not 'websocket'")
ErrConnectionFieldValue = errors.New("The value of the connection field is not 'upgrade'")
ErrSecWebSocketAccept = errors.New("The value of Sec-WebSocketAaccept field is invalid")
ErrHostCannotBeEmpty = errors.New("Host cannot be empty")
ErrSecWebSocketKey = errors.New("The value of SEC websocket key field is wrong")
ErrSecWebSocketVersion = errors.New("The value of SEC websocket version field is wrong, not 13")
ErrHTTPProtocolNotSupported = errors.New("HTTP protocol not supported")
ErrOnlyGETSupported = errors.New("error:Only get methods are supported")
ErrMaxControlFrameSize = errors.New("error:max control frame size > 125, need <= 125")
ErrRsv123 = errors.New("error:rsv1 or rsv2 or rsv3 has a value")
ErrOpcode = errors.New("error:wrong opcode")
ErrNOTBeFragmented = errors.New("error:since control message MUST NOT be fragmented")
ErrFrameOpcode = errors.New("error:since all data frames after the initial data frame must have opcode 0.")
ErrTextNotUTF8 = errors.New("error:text is not utf8 data")
ErrClosePayloadTooSmall = errors.New("error:close payload too small")
ErrCloseValue = errors.New("error:close value is wrong") // close值不对
ErrEmptyClose = errors.New("error:close value is empty") // close的值是空的
ErrWriteClosed = errors.New("write close")
)
var (
// 事件循环为空
ErrEventLoopEmpty = errors.New("event loop is empty, Need to call WithServerMultiEventLoop or WithClientMultiEventLoop for configuration")
// 事件循环没有启动
ErrEventLoopNotStart = errors.New("event loop not start")
)