-
Notifications
You must be signed in to change notification settings - Fork 3
/
errs.go
65 lines (49 loc) · 2.11 KB
/
errs.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
53
54
55
56
57
58
59
60
61
62
63
64
65
//
//
// Tencent is pleased to support the open source community by making tRPC available.
//
// Copyright (C) 2023 THL A29 Limited, a Tencent company.
// All rights reserved.
//
// If you have downloaded a copy of the tRPC source code from Tencent,
// please note that tRPC source code is licensed under the Apache 2.0 License,
// A copy of the Apache 2.0 License is included in this file.
//
//
// Package errs API gateway framework error related definitions, related methods
package errs
import trpcpb "trpc.group/trpc/trpc-protocol/pb/go/trpc"
const (
// Success status code
Success = 0
// ErrGatewayUnknown Distinguishing between unknown errors in the gateway and unknown error codes in trpc
ErrGatewayUnknown = trpcpb.TrpcRetCode(999)
// ErrWrongConfig Configuration error
ErrWrongConfig = trpcpb.TrpcRetCode(1001)
// ErrPathNotFound No route matched
ErrPathNotFound = trpcpb.TrpcRetCode(1002)
// ErrWrongContext Context type error (non-fasthttp context)
ErrWrongContext = trpcpb.TrpcRetCode(1003)
// ErrTargetServiceNotFound Failed to obtain the target server
ErrTargetServiceNotFound = trpcpb.TrpcRetCode(1004)
// ErrContextNoServiceVal Failed to obtain service information from the context
ErrContextNoServiceVal = trpcpb.TrpcRetCode(1005)
// ErrPluginConfigNotFound Failed to obtain plugin configuration from the context
ErrPluginConfigNotFound = trpcpb.TrpcRetCode(1006)
// ErrInvalidPluginConfig Plugin configuration error
ErrInvalidPluginConfig = trpcpb.TrpcRetCode(1007)
// ErrUpstreamRspErr upstream HTTP status code is not 200
ErrUpstreamRspErr = trpcpb.TrpcRetCode(1008)
// ErrInvalidReq Illegal request, protocol error, etc.
ErrInvalidReq = trpcpb.TrpcRetCode(1009)
// ErrUnSupportProtocol Unsupported protocol type
ErrUnSupportProtocol = trpcpb.TrpcRetCode(1010)
// ErrProtocolTrans Protocol conversion failed
ErrProtocolTrans = trpcpb.TrpcRetCode(1011)
// ErrConnClosed Connection pool closed
ErrConnClosed = trpcpb.TrpcRetCode(1012)
)
const (
// GatewayERRKey Reporting key for abnormal configuration loading to be used for monitoring and alerting
GatewayERRKey = "trpc_gateway_report"
)