waengine 1.7.5 → 1.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 🚀 WAEngine v1.7.5 - Ultra-Robust Edition
1
+ # 🚀 WAEngine v1.7.6 - Analytics Bugfix Edition
2
2
 
3
3
  [![NPM Version](https://img.shields.io/npm/v/waengine)](https://www.npmjs.com/package/waengine)
4
4
  [![Downloads](https://img.shields.io/npm/dm/waengine)](https://www.npmjs.com/package/waengine)
@@ -1383,3 +1383,58 @@ Thanks to all contributors who make this project possible! 🎉
1383
1383
  **Made with ❤️ for WhatsApp Automation**
1384
1384
 
1385
1385
  *The most powerful WhatsApp bot library - from 3-line bots to enterprise multi-device systems!*
1386
+
1387
+
1388
+ ---
1389
+
1390
+ ## 🔍 Error Codes System (NEW in v1.7.5!)
1391
+
1392
+ WAEngine now includes a comprehensive error code system with **80+ predefined error codes** for better debugging and error handling.
1393
+
1394
+ ### **Features**
1395
+ - ✅ **Fixed Error Codes** - No more dynamic timestamps (WAE-1001, WAE-2002, etc.)
1396
+ - ✅ **15 Categories** - Connection, Auth, File, Message, Group, Media, etc.
1397
+ - ✅ **German Descriptions** - Clear error descriptions in German
1398
+ - ✅ **Quick Fixes** - Automatic solution suggestions for common errors
1399
+ - ✅ **Error Statistics** - Track error frequency and patterns
1400
+ - ✅ **Full Documentation** - See [ERROR-CODES.md](./ERROR-CODES.md)
1401
+
1402
+ ### **Usage Example**
1403
+ ```javascript
1404
+ try {
1405
+ await client.connect();
1406
+ } catch (error) {
1407
+ console.log('Error Code:', error.code); // WAE-1001
1408
+ console.log('Description:', getErrorDescription(error.code));
1409
+ console.log('Category:', getErrorCategory(error.code));
1410
+ }
1411
+ ```
1412
+
1413
+ ### **Error Categories**
1414
+ - **WAE-1xxx** - Connection Errors
1415
+ - **WAE-2xxx** - Authentication Errors
1416
+ - **WAE-3xxx** - File System Errors
1417
+ - **WAE-4xxx** - Message Errors
1418
+ - **WAE-5xxx** - Group Errors
1419
+ - **WAE-6xxx** - Media Errors
1420
+ - **WAE-7xxx** - Command Errors
1421
+ - **WAE-8xxx** - Plugin Errors
1422
+ - **WAE-9xxx** - System Errors
1423
+ - **WAE-10xxx** - QR Code Errors
1424
+ - **WAE-11xxx** - Mobile Support Errors
1425
+ - **WAE-12xxx** - Recovery Errors
1426
+ - **WAE-13xxx** - Database Errors
1427
+ - **WAE-14xxx** - Network Errors
1428
+ - **WAE-15xxx** - Security Errors
1429
+
1430
+ ### **Error Statistics**
1431
+ ```javascript
1432
+ const stats = client.errorHandler.getErrorStats();
1433
+ console.log('Total Errors:', stats.totalErrors);
1434
+ console.log('Most Common:', stats.mostCommonError);
1435
+ console.log('By Code:', stats.errorsByCode);
1436
+ ```
1437
+
1438
+ **📖 Full Documentation:** [ERROR-CODES.md](./ERROR-CODES.md)
1439
+
1440
+ ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waengine",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "🚀 WAEngine - The most powerful WhatsApp Bot Library with 400+ Advanced Features, Ultra-Robust Recovery Systems & Production-Ready Stability",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -285,7 +285,14 @@ export class AdvancedMessage {
285
285
  export class AdvancedGroup {
286
286
  constructor(client) {
287
287
  this.client = client;
288
- this.socket = client.socket;
288
+ }
289
+
290
+ // Getter für Socket mit Null-Check
291
+ get socket() {
292
+ if (!this.client.socket) {
293
+ throw new Error('❌ Socket nicht verfügbar. Bot muss erst verbunden sein!');
294
+ }
295
+ return this.client.socket;
289
296
  }
290
297
 
291
298
  async setGroupSettings(groupId, settings) {
@@ -377,7 +384,14 @@ export class AdvancedGroup {
377
384
  export class AdvancedPrivacy {
378
385
  constructor(client) {
379
386
  this.client = client;
380
- this.socket = client.socket;
387
+ }
388
+
389
+ // Getter für Socket mit Null-Check
390
+ get socket() {
391
+ if (!this.client.socket) {
392
+ throw new Error('❌ Socket nicht verfügbar. Bot muss erst verbunden sein!');
393
+ }
394
+ return this.client.socket;
381
395
  }
382
396
 
383
397
  async blockUser(jid) {
@@ -449,7 +463,14 @@ export class AdvancedPrivacy {
449
463
  export class AdvancedAnalytics {
450
464
  constructor(client) {
451
465
  this.client = client;
452
- this.socket = client.socket;
466
+ }
467
+
468
+ // Getter für Socket mit Null-Check
469
+ get socket() {
470
+ if (!this.client.socket) {
471
+ throw new Error('❌ Socket nicht verfügbar. Bot muss erst verbunden sein!');
472
+ }
473
+ return this.client.socket;
453
474
  }
454
475
 
455
476
  async getDeliveryStatus(messageKey) {
@@ -531,7 +552,14 @@ export class AdvancedAnalytics {
531
552
  export class AdvancedStatus {
532
553
  constructor(client) {
533
554
  this.client = client;
534
- this.socket = client.socket;
555
+ }
556
+
557
+ // Getter für Socket mit Null-Check
558
+ get socket() {
559
+ if (!this.client.socket) {
560
+ throw new Error('❌ Socket nicht verfügbar. Bot muss erst verbunden sein!');
561
+ }
562
+ return this.client.socket;
535
563
  }
536
564
 
537
565
  async sendStatusUpdate(type, content, options = {}) {
@@ -595,7 +623,14 @@ export class AdvancedStatus {
595
623
  export class AdvancedBusiness {
596
624
  constructor(client) {
597
625
  this.client = client;
598
- this.socket = client.socket;
626
+ }
627
+
628
+ // Getter für Socket mit Null-Check
629
+ get socket() {
630
+ if (!this.client.socket) {
631
+ throw new Error('❌ Socket nicht verfügbar. Bot muss erst verbunden sein!');
632
+ }
633
+ return this.client.socket;
599
634
  }
600
635
 
601
636
  async setBusinessProfile(profile) {
@@ -677,7 +712,14 @@ export class AdvancedBusiness {
677
712
  export class AdvancedSystem {
678
713
  constructor(client) {
679
714
  this.client = client;
680
- this.socket = client.socket;
715
+ }
716
+
717
+ // Getter für Socket mit Null-Check
718
+ get socket() {
719
+ if (!this.client.socket) {
720
+ throw new Error('❌ Socket nicht verfügbar. Bot muss erst verbunden sein!');
721
+ }
722
+ return this.client.socket;
681
723
  }
682
724
 
683
725
  async createBackup() {
@@ -220,10 +220,10 @@ export class AnalyticsManager {
220
220
  // Store alerts
221
221
  if (alerts.length > 0) {
222
222
  this.alerts.push(...alerts);
223
- this.storage.write.in("analytics").push("alerts", alerts);
224
223
 
225
- // Emit alert events
224
+ // Store each alert individually
226
225
  alerts.forEach(alert => {
226
+ this.storage.write.in("analytics-alerts").push(alert);
227
227
  this.client.emit('performance_alert', alert);
228
228
  });
229
229
  }
@@ -0,0 +1,335 @@
1
+ // 🆔 WAEngine Error Codes System
2
+ // Eindeutige Fehler-IDs für alle Fehlertypen
3
+
4
+ export const ERROR_CODES = {
5
+ // 1xxx - Connection Errors
6
+ CONNECTION: {
7
+ FAILED: 'WAE-1001',
8
+ TIMEOUT: 'WAE-1002',
9
+ LOST: 'WAE-1003',
10
+ SOCKET_ERROR: 'WAE-1004',
11
+ RECONNECT_FAILED: 'WAE-1005',
12
+ MAX_RETRIES: 'WAE-1006',
13
+ NETWORK_UNREACHABLE: 'WAE-1007',
14
+ DNS_FAILED: 'WAE-1008'
15
+ },
16
+
17
+ // 2xxx - Authentication Errors
18
+ AUTH: {
19
+ FAILED: 'WAE-2001',
20
+ SESSION_EXPIRED: 'WAE-2002',
21
+ SESSION_CORRUPTED: 'WAE-2003',
22
+ INVALID_CREDENTIALS: 'WAE-2004',
23
+ LOGOUT_DETECTED: 'WAE-2005',
24
+ CREDENTIALS_MISSING: 'WAE-2006',
25
+ LOGIN_REQUIRED: 'WAE-2007',
26
+ LOGOUT_FAILED: 'WAE-2008'
27
+ },
28
+
29
+ // 3xxx - File System Errors
30
+ FILE: {
31
+ NOT_FOUND: 'WAE-3001',
32
+ PERMISSION_DENIED: 'WAE-3002',
33
+ DISK_FULL: 'WAE-3003',
34
+ TOO_LARGE: 'WAE-3004',
35
+ INVALID_FORMAT: 'WAE-3005',
36
+ READ_ERROR: 'WAE-3006',
37
+ WRITE_ERROR: 'WAE-3007',
38
+ DELETE_ERROR: 'WAE-3008',
39
+ CORRUPTED: 'WAE-3009'
40
+ },
41
+
42
+ // 4xxx - Message Errors
43
+ MESSAGE: {
44
+ SEND_FAILED: 'WAE-4001',
45
+ INVALID_RECIPIENT: 'WAE-4002',
46
+ TOO_LONG: 'WAE-4003',
47
+ MEDIA_UPLOAD_FAILED: 'WAE-4004',
48
+ INVALID_FORMAT: 'WAE-4005',
49
+ RECEIVE_FAILED: 'WAE-4006',
50
+ MEDIA_DOWNLOAD_FAILED: 'WAE-4007',
51
+ MEDIA_TOO_LARGE: 'WAE-4008'
52
+ },
53
+
54
+ // 5xxx - Group Errors
55
+ GROUP: {
56
+ NOT_A_GROUP: 'WAE-5001',
57
+ NOT_ADMIN: 'WAE-5002',
58
+ USER_NOT_FOUND: 'WAE-5003',
59
+ NOT_FOUND: 'WAE-5004',
60
+ ACTION_RESTRICTED: 'WAE-5005',
61
+ PERMISSION_DENIED: 'WAE-5006',
62
+ INVALID_SETTINGS: 'WAE-5007'
63
+ },
64
+
65
+ // 6xxx - Media Errors
66
+ MEDIA: {
67
+ DOWNLOAD_FAILED: 'WAE-6001',
68
+ CONVERSION_FAILED: 'WAE-6002',
69
+ STICKER_CREATION_FAILED: 'WAE-6003',
70
+ INVALID_TYPE: 'WAE-6004',
71
+ TOO_LARGE: 'WAE-6005',
72
+ UPLOAD_FAILED: 'WAE-6006',
73
+ PROCESSING_FAILED: 'WAE-6007'
74
+ },
75
+
76
+ // 7xxx - Command Errors
77
+ COMMAND: {
78
+ NOT_FOUND: 'WAE-7001',
79
+ EXECUTION_FAILED: 'WAE-7002',
80
+ INVALID_ARGUMENTS: 'WAE-7003',
81
+ PERMISSION_DENIED: 'WAE-7004',
82
+ COOLDOWN_ACTIVE: 'WAE-7005',
83
+ DISABLED: 'WAE-7006'
84
+ },
85
+
86
+ // 8xxx - Plugin Errors
87
+ PLUGIN: {
88
+ LOAD_FAILED: 'WAE-8001',
89
+ NOT_FOUND: 'WAE-8002',
90
+ INVALID_CONFIG: 'WAE-8003',
91
+ DEPENDENCY_MISSING: 'WAE-8004',
92
+ VERSION_INCOMPATIBLE: 'WAE-8005',
93
+ INITIALIZATION_FAILED: 'WAE-8006',
94
+ EXECUTION_FAILED: 'WAE-8007'
95
+ },
96
+
97
+ // 9xxx - System Errors
98
+ SYSTEM: {
99
+ OUT_OF_MEMORY: 'WAE-9001',
100
+ PROCESS_CRASHED: 'WAE-9002',
101
+ UNKNOWN_ERROR: 'WAE-9003',
102
+ CONFIGURATION_INVALID: 'WAE-9004',
103
+ INITIALIZATION_FAILED: 'WAE-9005',
104
+ DEPENDENCY_MISSING: 'WAE-9006',
105
+ VERSION_MISMATCH: 'WAE-9007'
106
+ },
107
+
108
+ // 10xxx - QR Code Errors
109
+ QR: {
110
+ GENERATION_FAILED: 'WAE-10001',
111
+ DISPLAY_FAILED: 'WAE-10002',
112
+ SCAN_TIMEOUT: 'WAE-10003',
113
+ INVALID_DATA: 'WAE-10004',
114
+ BROWSER_OPEN_FAILED: 'WAE-10005',
115
+ TERMINAL_INCOMPATIBLE: 'WAE-10006'
116
+ },
117
+
118
+ // 11xxx - Mobile Support Errors
119
+ MOBILE: {
120
+ DETECTION_FAILED: 'WAE-11001',
121
+ PAIRING_FAILED: 'WAE-11002',
122
+ CODE_INVALID: 'WAE-11003',
123
+ NOT_SUPPORTED: 'WAE-11004',
124
+ TIMEOUT: 'WAE-11005'
125
+ },
126
+
127
+ // 12xxx - Recovery Errors
128
+ RECOVERY: {
129
+ FAILED: 'WAE-12001',
130
+ BACKUP_NOT_FOUND: 'WAE-12002',
131
+ BACKUP_CORRUPTED: 'WAE-12003',
132
+ RESTORE_FAILED: 'WAE-12004',
133
+ AUTO_BACKUP_FAILED: 'WAE-12005'
134
+ },
135
+
136
+ // 13xxx - Database Errors
137
+ DATABASE: {
138
+ CONNECTION_FAILED: 'WAE-13001',
139
+ QUERY_FAILED: 'WAE-13002',
140
+ MIGRATION_FAILED: 'WAE-13003',
141
+ DATA_CORRUPTED: 'WAE-13004',
142
+ TIMEOUT: 'WAE-13005'
143
+ },
144
+
145
+ // 14xxx - Network Errors
146
+ NETWORK: {
147
+ DNS_FAILED: 'WAE-14001',
148
+ PROXY_FAILED: 'WAE-14002',
149
+ SSL_ERROR: 'WAE-14003',
150
+ RATE_LIMITED: 'WAE-14004',
151
+ FIREWALL_BLOCKED: 'WAE-14005'
152
+ },
153
+
154
+ // 15xxx - Security Errors
155
+ SECURITY: {
156
+ UNAUTHORIZED: 'WAE-15001',
157
+ TOKEN_EXPIRED: 'WAE-15002',
158
+ INVALID_TOKEN: 'WAE-15003',
159
+ ACCESS_DENIED: 'WAE-15004',
160
+ ENCRYPTION_FAILED: 'WAE-15005'
161
+ }
162
+ };
163
+
164
+ // Error Code Descriptions (Deutsch)
165
+ const ErrorDescriptions = {
166
+ // 1xxx - Connection Errors
167
+ 'WAE-1001': 'Verbindung fehlgeschlagen',
168
+ 'WAE-1002': 'Verbindungs-Timeout',
169
+ 'WAE-1003': 'Verbindung verloren',
170
+ 'WAE-1004': 'Socket-Fehler',
171
+ 'WAE-1005': 'Wiederverbindung fehlgeschlagen',
172
+ 'WAE-1006': 'Maximale Wiederverbindungsversuche überschritten',
173
+ 'WAE-1007': 'Netzwerk nicht erreichbar',
174
+ 'WAE-1008': 'DNS-Auflösung fehlgeschlagen',
175
+
176
+ // 2xxx - Authentication Errors
177
+ 'WAE-2001': 'Authentifizierung fehlgeschlagen',
178
+ 'WAE-2002': 'Session abgelaufen',
179
+ 'WAE-2003': 'Session korrupt',
180
+ 'WAE-2004': 'Credentials ungültig',
181
+ 'WAE-2005': 'Logout erkannt',
182
+ 'WAE-2006': 'Credentials fehlen',
183
+ 'WAE-2007': 'Login erforderlich',
184
+ 'WAE-2008': 'Logout fehlgeschlagen',
185
+
186
+ // 3xxx - File System Errors
187
+ 'WAE-3001': 'Datei nicht gefunden',
188
+ 'WAE-3002': 'Zugriff verweigert',
189
+ 'WAE-3003': 'Festplatte voll',
190
+ 'WAE-3004': 'Datei zu groß',
191
+ 'WAE-3005': 'Dateiformat ungültig',
192
+ 'WAE-3006': 'Datei-Lesefehler',
193
+ 'WAE-3007': 'Datei-Schreibfehler',
194
+ 'WAE-3008': 'Datei-Löschfehler',
195
+ 'WAE-3009': 'Datei korrupt',
196
+
197
+ // 4xxx - Message Errors
198
+ 'WAE-4001': 'Nachricht senden fehlgeschlagen',
199
+ 'WAE-4002': 'Empfänger ungültig',
200
+ 'WAE-4003': 'Nachricht zu lang',
201
+ 'WAE-4004': 'Medien-Upload fehlgeschlagen',
202
+ 'WAE-4005': 'Nachrichtenformat ungültig',
203
+ 'WAE-4006': 'Nachricht empfangen fehlgeschlagen',
204
+ 'WAE-4007': 'Medien-Download fehlgeschlagen',
205
+ 'WAE-4008': 'Medien zu groß',
206
+
207
+ // 5xxx - Group Errors
208
+ 'WAE-5001': 'Keine Gruppe',
209
+ 'WAE-5002': 'Kein Admin',
210
+ 'WAE-5003': 'User nicht gefunden',
211
+ 'WAE-5004': 'Gruppe nicht gefunden',
212
+ 'WAE-5005': 'Aktion eingeschränkt',
213
+ 'WAE-5006': 'Gruppenberechtigung verweigert',
214
+ 'WAE-5007': 'Gruppeneinstellungen ungültig',
215
+
216
+ // 6xxx - Media Errors
217
+ 'WAE-6001': 'Media-Download fehlgeschlagen',
218
+ 'WAE-6002': 'Media-Konvertierung fehlgeschlagen',
219
+ 'WAE-6003': 'Sticker-Erstellung fehlgeschlagen',
220
+ 'WAE-6004': 'Media-Typ ungültig',
221
+ 'WAE-6005': 'Media zu groß',
222
+ 'WAE-6006': 'Media-Upload fehlgeschlagen',
223
+ 'WAE-6007': 'Media-Verarbeitung fehlgeschlagen',
224
+
225
+ // 7xxx - Command Errors
226
+ 'WAE-7001': 'Command nicht gefunden',
227
+ 'WAE-7002': 'Command-Ausführung fehlgeschlagen',
228
+ 'WAE-7003': 'Command-Argumente ungültig',
229
+ 'WAE-7004': 'Command-Berechtigung verweigert',
230
+ 'WAE-7005': 'Command-Cooldown aktiv',
231
+ 'WAE-7006': 'Command deaktiviert',
232
+
233
+ // 8xxx - Plugin Errors
234
+ 'WAE-8001': 'Plugin-Laden fehlgeschlagen',
235
+ 'WAE-8002': 'Plugin nicht gefunden',
236
+ 'WAE-8003': 'Plugin-Konfiguration ungültig',
237
+ 'WAE-8004': 'Plugin-Abhängigkeit fehlt',
238
+ 'WAE-8005': 'Plugin-Version inkompatibel',
239
+ 'WAE-8006': 'Plugin-Initialisierung fehlgeschlagen',
240
+ 'WAE-8007': 'Plugin-Ausführung fehlgeschlagen',
241
+
242
+ // 9xxx - System Errors
243
+ 'WAE-9001': 'Speicher voll',
244
+ 'WAE-9002': 'Prozess abgestürzt',
245
+ 'WAE-9003': 'Unbekannter Fehler',
246
+ 'WAE-9004': 'Konfiguration ungültig',
247
+ 'WAE-9005': 'Initialisierung fehlgeschlagen',
248
+ 'WAE-9006': 'Abhängigkeit fehlt',
249
+ 'WAE-9007': 'Versions-Konflikt',
250
+
251
+ // 10xxx - QR Code Errors
252
+ 'WAE-10001': 'QR-Code Generierung fehlgeschlagen',
253
+ 'WAE-10002': 'QR-Code Anzeige fehlgeschlagen',
254
+ 'WAE-10003': 'QR-Code Scan Timeout',
255
+ 'WAE-10004': 'QR-Daten ungültig',
256
+ 'WAE-10005': 'Browser-Öffnung fehlgeschlagen',
257
+ 'WAE-10006': 'Terminal inkompatibel',
258
+
259
+ // 11xxx - Mobile Support Errors
260
+ 'WAE-11001': 'Mobile-Erkennung fehlgeschlagen',
261
+ 'WAE-11002': 'Mobile-Pairing fehlgeschlagen',
262
+ 'WAE-11003': 'Pairing-Code ungültig',
263
+ 'WAE-11004': 'Mobile nicht unterstützt',
264
+ 'WAE-11005': 'Mobile-Timeout',
265
+
266
+ // 12xxx - Recovery Errors
267
+ 'WAE-12001': 'Recovery fehlgeschlagen',
268
+ 'WAE-12002': 'Backup nicht gefunden',
269
+ 'WAE-12003': 'Backup korrupt',
270
+ 'WAE-12004': 'Wiederherstellung fehlgeschlagen',
271
+ 'WAE-12005': 'Auto-Backup fehlgeschlagen',
272
+
273
+ // 13xxx - Database Errors
274
+ 'WAE-13001': 'Datenbankverbindung fehlgeschlagen',
275
+ 'WAE-13002': 'Datenbankabfrage fehlgeschlagen',
276
+ 'WAE-13003': 'Datenbank-Migration fehlgeschlagen',
277
+ 'WAE-13004': 'Daten korrupt',
278
+ 'WAE-13005': 'Datenbank-Timeout',
279
+
280
+ // 14xxx - Network Errors
281
+ 'WAE-14001': 'DNS fehlgeschlagen',
282
+ 'WAE-14002': 'Proxy fehlgeschlagen',
283
+ 'WAE-14003': 'SSL-Fehler',
284
+ 'WAE-14004': 'Rate-Limit erreicht',
285
+ 'WAE-14005': 'Firewall blockiert',
286
+
287
+ // 15xxx - Security Errors
288
+ 'WAE-15001': 'Nicht autorisiert',
289
+ 'WAE-15002': 'Token abgelaufen',
290
+ 'WAE-15003': 'Token ungültig',
291
+ 'WAE-15004': 'Zugriff verweigert',
292
+ 'WAE-15005': 'Verschlüsselung fehlgeschlagen'
293
+ };
294
+
295
+ // Get error description
296
+ export function getErrorDescription(errorCode) {
297
+ return ErrorDescriptions[errorCode] || 'Unbekannter Fehler';
298
+ }
299
+
300
+ // Create error with code
301
+ export function createError(errorCode, message, context = {}) {
302
+ const description = getErrorDescription(errorCode);
303
+ const error = new Error(message || description);
304
+ error.code = errorCode;
305
+ error.description = description;
306
+ error.context = context;
307
+ error.timestamp = Date.now();
308
+ return error;
309
+ }
310
+
311
+ // Check if error code exists
312
+ export function isValidErrorCode(errorCode) {
313
+ return errorCode in ErrorDescriptions;
314
+ }
315
+
316
+ // Get error category
317
+ export function getErrorCategory(errorCode) {
318
+ const code = parseInt(errorCode.split('-')[1]);
319
+ if (code >= 1000 && code < 2000) return 'Connection';
320
+ if (code >= 2000 && code < 3000) return 'Authentication';
321
+ if (code >= 3000 && code < 4000) return 'File System';
322
+ if (code >= 4000 && code < 5000) return 'Message';
323
+ if (code >= 5000 && code < 6000) return 'Group';
324
+ if (code >= 6000 && code < 7000) return 'Media';
325
+ if (code >= 7000 && code < 8000) return 'Command';
326
+ if (code >= 8000 && code < 9000) return 'Plugin';
327
+ if (code >= 9000 && code < 10000) return 'System';
328
+ if (code >= 10000 && code < 11000) return 'QR Code';
329
+ if (code >= 11000 && code < 12000) return 'Mobile';
330
+ if (code >= 12000 && code < 13000) return 'Recovery';
331
+ if (code >= 13000 && code < 14000) return 'Database';
332
+ if (code >= 14000 && code < 15000) return 'Network';
333
+ if (code >= 15000 && code < 16000) return 'Security';
334
+ return 'Unknown';
335
+ }