-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-error-codes.js
More file actions
45 lines (39 loc) · 1.37 KB
/
test-error-codes.js
File metadata and controls
45 lines (39 loc) · 1.37 KB
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
// Test script to verify error codes show up in dashboard
// Run this with: node test-error-codes.js
// Simulate various error types with codes
setTimeout(() => {
// Test 1: Standard Error with code
const error1 = new Error("Test error with code");
error1.code = "TEST_ERROR_001";
error1.cause = { reason: "Testing error display", severity: "low" };
console.error(error1);
}, 1000);
setTimeout(() => {
// Test 2: Custom error with complex cause
const error2 = new Error("Database connection failed");
error2.code = "DB_CONNECTION_ERROR";
error2.cause = {
host: "localhost",
port: 5432,
database: "mcp_db",
retries: 3
};
console.error("Database error:", error2);
}, 2000);
setTimeout(() => {
// Test 3: API Error
const error3 = new Error("API request failed");
error3.code = "API_ERROR_429";
error3.statusCode = 429;
error3.cause = { message: "Rate limit exceeded", resetTime: "60s" };
console.error("API Error:", error3);
}, 3000);
setTimeout(() => {
// Test 4: Regular log
console.log("Regular log message - should appear immediately in dashboard");
}, 4000);
setTimeout(() => {
// Test 5: Info log
console.info("Info message with details", { userId: 123, action: "login" });
}, 5000);
console.log("Error code test script started. Check your dashboard for immediate updates!");