@@ -196,10 +196,8 @@ export class ConfigLoader extends EventEmitter {
196196 try {
197197 console . log ( `Loading configuration from ${ source . type } source` ) ;
198198 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 ) ;
203201 return null ;
204202 }
205203 } ) ,
@@ -234,7 +232,7 @@ export class ConfigLoader extends EventEmitter {
234232 } else {
235233 console . log ( 'Configuration has not changed, no update needed' ) ;
236234 }
237- } catch ( error : unknown ) {
235+ } catch ( error : any ) {
238236 console . error ( 'Error reloading configuration:' , error ) ;
239237 this . emit ( 'configurationError' , error ) ;
240238 } finally {
@@ -330,24 +328,18 @@ export class ConfigLoader extends EventEmitter {
330328 try {
331329 await execFileAsync ( 'git' , [ 'clone' , source . repository , repoDir ] , execOptions ) ;
332330 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 } ` ) ;
339334 }
340335 } else {
341336 console . log ( `Pulling latest changes from ${ source . repository } ` ) ;
342337 try {
343338 await execFileAsync ( 'git' , [ 'pull' ] , { cwd : repoDir } ) ;
344339 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 } ` ) ;
351343 }
352344 }
353345
@@ -357,12 +349,9 @@ export class ConfigLoader extends EventEmitter {
357349 try {
358350 await execFileAsync ( 'git' , [ 'checkout' , source . branch ] , { cwd : repoDir } ) ;
359351 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 } ` ) ;
366355 }
367356 }
368357
@@ -382,12 +371,9 @@ export class ConfigLoader extends EventEmitter {
382371 const config = JSON . parse ( content ) ;
383372 console . log ( 'Configuration loaded successfully from Git' ) ;
384373 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 } ` ) ;
391377 }
392378 }
393379
0 commit comments