(command: string, timeoutMs: number)
| 131 | |
| 132 | class TimeoutError extends Error { |
| 133 | constructor(command: string, timeoutMs: number) { |
| 134 | super( |
| 135 | `Command timed out after ${timeoutMs / 1000}s: ${command.slice(0, 100)}${command.length > 100 ? '...' : ''}`, |
| 136 | ); |
| 137 | this.name = 'TimeoutError'; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | function withTimeout<T>(promise: Promise<T>, timeoutMs: number, command: string): Promise<T> { |
nothing calls this directly
no outgoing calls
no test coverage detected