@@ -196,10 +196,8 @@ export class ConfigLoader extends EventEmitter {
196
196
try {
197
197
console . log ( `Loading configuration from ${ source . type } source` ) ;
198
198
return await this . loadFromSource ( source ) ;
199
- } catch ( error : unknown ) {
200
- if ( error instanceof Error ) {
201
- console . error ( `Error loading from ${ source . type } source:` , error . message ) ;
202
- }
199
+ } catch ( error : any ) {
200
+ console . error ( `Error loading from ${ source . type } source:` , error . message ) ;
203
201
return null ;
204
202
}
205
203
} ) ,
@@ -234,7 +232,7 @@ export class ConfigLoader extends EventEmitter {
234
232
} else {
235
233
console . log ( 'Configuration has not changed, no update needed' ) ;
236
234
}
237
- } catch ( error : unknown ) {
235
+ } catch ( error : any ) {
238
236
console . error ( 'Error reloading configuration:' , error ) ;
239
237
this . emit ( 'configurationError' , error ) ;
240
238
} finally {
@@ -330,24 +328,18 @@ export class ConfigLoader extends EventEmitter {
330
328
try {
331
329
await execFileAsync ( 'git' , [ 'clone' , source . repository , repoDir ] , execOptions ) ;
332
330
console . log ( 'Repository cloned successfully' ) ;
333
- } catch ( error : unknown ) {
334
- if ( error instanceof Error ) {
335
- console . error ( 'Failed to clone repository:' , error . message ) ;
336
- throw new Error ( `Failed to clone repository: ${ error . message } ` ) ;
337
- }
338
- throw error ;
331
+ } catch ( error : any ) {
332
+ console . error ( 'Failed to clone repository:' , error . message ) ;
333
+ throw new Error ( `Failed to clone repository: ${ error . message } ` ) ;
339
334
}
340
335
} else {
341
336
console . log ( `Pulling latest changes from ${ source . repository } ` ) ;
342
337
try {
343
338
await execFileAsync ( 'git' , [ 'pull' ] , { cwd : repoDir } ) ;
344
339
console . log ( 'Repository pulled successfully' ) ;
345
- } catch ( error : unknown ) {
346
- if ( error instanceof Error ) {
347
- console . error ( 'Failed to pull repository:' , error . message ) ;
348
- throw new Error ( `Failed to pull repository: ${ error . message } ` ) ;
349
- }
350
- throw error ;
340
+ } catch ( error : any ) {
341
+ console . error ( 'Failed to pull repository:' , error . message ) ;
342
+ throw new Error ( `Failed to pull repository: ${ error . message } ` ) ;
351
343
}
352
344
}
353
345
@@ -357,12 +349,9 @@ export class ConfigLoader extends EventEmitter {
357
349
try {
358
350
await execFileAsync ( 'git' , [ 'checkout' , source . branch ] , { cwd : repoDir } ) ;
359
351
console . log ( `Branch ${ source . branch } checked out successfully` ) ;
360
- } catch ( error : unknown ) {
361
- if ( error instanceof Error ) {
362
- console . error ( `Failed to checkout branch ${ source . branch } :` , error . message ) ;
363
- throw new Error ( `Failed to checkout branch ${ source . branch } : ${ error . message } ` ) ;
364
- }
365
- throw error ;
352
+ } catch ( error : any ) {
353
+ console . error ( `Failed to checkout branch ${ source . branch } :` , error . message ) ;
354
+ throw new Error ( `Failed to checkout branch ${ source . branch } : ${ error . message } ` ) ;
366
355
}
367
356
}
368
357
@@ -382,12 +371,9 @@ export class ConfigLoader extends EventEmitter {
382
371
const config = JSON . parse ( content ) ;
383
372
console . log ( 'Configuration loaded successfully from Git' ) ;
384
373
return config ;
385
- } catch ( error : unknown ) {
386
- if ( error instanceof Error ) {
387
- console . error ( 'Failed to read or parse configuration file:' , error . message ) ;
388
- throw new Error ( `Failed to read or parse configuration file: ${ error . message } ` ) ;
389
- }
390
- throw error ;
374
+ } catch ( error : any ) {
375
+ console . error ( 'Failed to read or parse configuration file:' , error . message ) ;
376
+ throw new Error ( `Failed to read or parse configuration file: ${ error . message } ` ) ;
391
377
}
392
378
}
393
379
0 commit comments