feat: Update error handling to use getErrorMessage utility and improve logging across multiple services
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user