feat: Update error handling to use getErrorMessage utility and improve logging across multiple services

This commit is contained in:
2025-11-25 08:25:54 +00:00
parent c59d56e70a
commit e94906b3bf
13 changed files with 97 additions and 75 deletions

View File

@@ -11,6 +11,7 @@ import type {
ISslCertificate,
IServiceDeployOptions,
} from '../types.ts';
import { getErrorMessage } from '../utils/error.ts';
export class OneboxApiClient {
private baseUrl: string;
@@ -193,7 +194,7 @@ export class OneboxApiClient {
return await response.json();
} catch (error) {
if (error.name === 'TimeoutError') {
if (error instanceof Error && error.name === 'TimeoutError') {
throw new Error('Request timed out. Daemon might be unresponsive.');
}
throw error;