-
Notifications
You must be signed in to change notification settings - Fork 2
/
errors.go
36 lines (34 loc) · 1.02 KB
/
errors.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
package main
const (
ErrParse = -32700
ErrInvalidRequest = -32600
ErrInternal = -32603
ErrInvalidParams = -32602
ErrMethodNotFound = -32601
ErrTtlExpired = -32011
ErrPermissionDenied = -32010
ErrLockNotOwned = -32006
ErrUserExists = -32005
ErrInvalidUser = -32004
ErrInvalidPipe = -32003
ErrInvalidTask = -32002
ErrCancel = -32001
ErrTimeout = -32000
ErrNoError = 0
)
var ErrStr = map[int]string{
ErrParse: "Parse error",
ErrInvalidRequest: "Invalid request",
ErrMethodNotFound: "Method not found",
ErrInvalidParams: "Invalid params",
ErrInternal: "Internal error",
ErrTimeout: "Timeout",
ErrCancel: "Cancel",
ErrInvalidTask: "Invalid task",
ErrInvalidPipe: "Invalid pipe",
ErrInvalidUser: "Invalid user",
ErrUserExists: "User already exists",
ErrPermissionDenied: "Permission denied",
ErrTtlExpired: "TTL expired",
ErrLockNotOwned: "Lock not owned",
}