/
errcode.proto
191 lines (153 loc) · 4.83 KB
/
errcode.proto
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
syntax = "proto3";
package berty.errcode;
import "gogoproto/gogo.proto";
option go_package = "berty.tech/berty/go/pkg/errcode";
option (gogoproto.goproto_enum_prefix_all) = false;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
enum ErrCode {
//----------------
// Special errors
//----------------
Undefined = 0; // default value, should never be set manually
TODO = 666; // indicates that you plan to create an error later
ErrNotImplemented = 777; // indicates that a method is not implemented yet
ErrInternal = 888; // indicates an unknown error (without Code), i.e. in gRPC
//----------------
// Generic errors
//----------------
// Parameters and I/O errors
ErrInvalidInput = 100;
ErrInvalidRange = 101;
ErrMissingInput = 102;
ErrSerialization = 103;
ErrDeserialization = 104;
ErrStreamRead = 105;
ErrStreamWrite = 106;
ErrStreamTransform = 110;
ErrStreamSendAndClose = 111;
ErrStreamHeaderWrite = 112;
ErrStreamHeaderRead = 115;
ErrStreamSink = 113;
ErrStreamCloseAndRecv = 114;
ErrMissingMapKey = 107;
ErrDBWrite = 108;
ErrDBRead = 109;
ErrDBDestroy = 120;
ErrDBMigrate = 121;
ErrDBReplay = 122;
ErrDBRestore = 123;
ErrDBOpen = 124;
ErrDBClose = 125;
// Crypto errors
ErrCryptoRandomGeneration = 200;
ErrCryptoKeyGeneration = 201;
ErrCryptoNonceGeneration = 202;
ErrCryptoSignature = 203;
ErrCryptoSignatureVerification = 204;
ErrCryptoDecrypt = 205;
ErrCryptoDecryptPayload = 206;
ErrCryptoEncrypt = 207;
ErrCryptoKeyConversion = 208;
ErrCryptoCipherInit = 209;
ErrCryptoKeyDerivation = 210;
// Pattern errors
ErrMap = 300;
ErrForEach = 301;
// Keystore errors
ErrKeystoreGet = 400;
ErrKeystorePut = 401;
ErrNotFound = 404; // generic
//-----------------
// Specific errors
//-----------------
// IPFS errors
ErrIPFSAdd = 1050;
ErrIPFSGet = 1051;
ErrIPFSInit = 1052;
ErrIPFSSetupConfig = 1053;
ErrIPFSSetupRepo = 1054;
ErrIPFSSetupHost = 1055;
// Event errors
ErrEventListMetadata = 1400;
ErrEventListMessage = 1401;
// Bridge errors
ErrBridgeInterrupted = 1600;
ErrBridgeNotRunning = 1601;
//------------------
// Messenger errors
//------------------
ErrMessengerInvalidDeepLink = 2000;
ErrMessengerDeepLinkRequiresPassphrase = 2001;
ErrMessengerDeepLinkInvalidPassphrase = 2002;
ErrMessengerStreamEvent = 2003;
ErrMessengerContactMetadataUnmarshal = 2004;
// DB errors
ErrDBEntryAlreadyExists = 2100;
ErrDBAddConversation = 2101;
ErrDBAddContactRequestOutgoingSent = 2102;
ErrDBAddContactRequestOutgoingEnqueud = 2103;
ErrDBAddContactRequestIncomingReceived = 2104;
ErrDBAddContactRequestIncomingAccepted = 2105;
ErrDBAddGroupMemberDeviceAdded = 2106;
ErrDBMultipleRecords = 2107;
// Replay errors
ErrReplayProcessGroupMetadata = 2200;
ErrReplayProcessGroupMessage = 2201;
// API internals errors
ErrAttachmentPrepare = 2300;
ErrAttachmentRetrieve = 2301;
ErrProtocolSend = 2302;
ErrProtocolEventUnmarshal = 2303;
ErrProtocolGetGroupInfo = 2304;
// Test Error
ErrTestEcho = 2401;
ErrTestEchoRecv = 2402;
ErrTestEchoSend = 2403;
// -----------------
// CLI
// -----------------
ErrCLINoTermcaps = 3001;
ErrServicesDirectory = 4200;
ErrServicesDirectoryInvalidVerifiedCredentialSubject = 4201;
ErrServicesDirectoryExistingRecordNotFound = 4202;
ErrServicesDirectoryRecordLockedAndCantBeReplaced = 4203;
ErrServicesDirectoryExplicitReplaceFlagRequired = 4204;
ErrServicesDirectoryInvalidVerifiedCredential = 4205;
ErrServicesDirectoryExpiredVerifiedCredential = 4206;
ErrServicesDirectoryInvalidVerifiedCredentialID = 4207;
ErrBertyAccount = 5000;
ErrBertyAccountNoIDSpecified = 5001;
ErrBertyAccountAlreadyOpened = 5002;
ErrBertyAccountInvalidIDFormat = 5003;
ErrBertyAccountLoggerDecorator = 5004;
ErrBertyAccountGRPCClient = 5005;
ErrBertyAccountOpenAccount = 5006;
ErrBertyAccountDataNotFound = 5007;
ErrBertyAccountMetadataUpdate = 5008;
ErrBertyAccountManagerOpen = 5009;
ErrBertyAccountManagerClose = 5010;
ErrBertyAccountInvalidCLIArgs = 5011;
ErrBertyAccountFSError = 5012;
ErrBertyAccountAlreadyExists = 5013;
ErrBertyAccountNoBackupSpecified = 5014;
ErrBertyAccountIDGenFailed = 5015;
ErrBertyAccountCreationFailed = 5016;
ErrBertyAccountUpdateFailed = 5017;
ErrAppStorageNotSupported = 5018;
// Push Services
ErrPush = 6000;
ErrPushWrongAccount = 6001;
ErrPushUnableToDecrypt = 6002;
ErrPushInvalidPayload = 6003;
ErrPushInvalidServerConfig = 6004;
ErrPushMissingBundleID = 6005;
ErrPushUnknownDestination = 6006;
ErrPushProvider = 6007;
ErrPushUnknownProvider = 6008;
ErrNoProvidersConfigured = 6009;
ErrInvalidPrivateKey = 6010;
ErrPushServerNotFound = 6011;
}
message ErrDetails { repeated ErrCode codes = 1; }