chore: initialize qiming workspace repository

This commit is contained in:
Codex
2026-05-29 14:22:48 +08:00
commit bfd67a0f2c
10750 changed files with 1885711 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
/**
* Unified error types for qiming-mcp-stdio-proxy
*
* Provides structured error handling across all modules.
*/
/** Connection error - used for transport layer connection failures */
export class ConnectionError extends Error {
constructor(
public readonly serverId: string,
public readonly cause: Error,
) {
super(`Connection failed for "${serverId}": ${cause.message}`);
this.name = 'ConnectionError';
}
}
/** Tool call error - used for tool execution failures */
export class ToolCallError extends Error {
constructor(
public readonly toolName: string,
public readonly serverId: string | undefined,
public readonly cause: Error,
) {
super(`Tool "${toolName}" call failed: ${cause.message}`);
this.name = 'ToolCallError';
}
}
/** Health check error - used for heartbeat detection failures */
export class HealthCheckError extends Error {
constructor(
public readonly serverId: string,
public readonly consecutiveFailures: number,
) {
super(`Health check failed for "${serverId}" (${consecutiveFailures} consecutive failures)`);
this.name = 'HealthCheckError';
}
}
/** Configuration error - used for config validation failures */
export class ConfigError extends Error {
constructor(message: string) {
super(message);
this.name = 'ConfigError';
}
}