refactor: consolidate failure classification constructors
This commit is contained in:
@@ -21,12 +21,6 @@ export function isTimeoutMessage(message: string): boolean {
|
||||
return /timed out after/i.test(message);
|
||||
}
|
||||
|
||||
export function isTimeoutLikeError(error: unknown): boolean {
|
||||
if (!(error instanceof Error)) return false;
|
||||
if (error.name === 'TimeoutError' || error.name === 'AbortError') return true;
|
||||
return isTimeoutMessage(error.message);
|
||||
}
|
||||
|
||||
export function timeoutMessage(command: string, args: string[], timeoutMs: number): string {
|
||||
return `gsd-tools timed out after ${timeoutMs}ms: ${command} ${args.join(' ')}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user