fixed up logger error to make it better to handle in code

This commit is contained in:
Bojan Kucera 2025-06-07 11:58:24 -04:00
parent db66687f48
commit d0bb4db042
18 changed files with 51 additions and 45 deletions

View file

@ -97,7 +97,7 @@ export class ProxyService {
try {
await this.scrapeProxies();
} catch (error) {
this.logger.error('Error in periodic proxy refresh', {error});
this.logger.error('Error in periodic proxy refresh', error);
}
}, intervalMs);
}
@ -318,7 +318,7 @@ export class ProxyService {
}
}
} catch (error) {
this.logger.error('Error updating proxy status', {error});
this.logger.error('Error updating proxy status', error);
}
}
/**
@ -346,7 +346,7 @@ export class ProxyService {
this.logger.warn('No working proxies available');
return null;
} catch (error) {
this.logger.error('Error getting working proxy', {error});
this.logger.error('Error getting working proxy', error);
return null;
}
}
@ -371,7 +371,7 @@ export class ProxyService {
return workingProxies;
} catch (error) {
this.logger.error('Error getting working proxies', {error});
this.logger.error('Error getting working proxies', error);
return [];
}
}
@ -391,7 +391,7 @@ export class ProxyService {
this.logger.warn('getAllProxies not fully implemented - Redis cache provider limitations');
return proxies;
} catch (error) {
this.logger.error('Error getting all proxies', {error});
this.logger.error('Error getting all proxies', error);
return [];
}
}
@ -424,7 +424,7 @@ export class ProxyService {
return stats;
} catch (error) {
this.logger.error('Error getting proxy stats', {error});
this.logger.error('Error getting proxy stats', error);
return {
total: 0,
working: 0,
@ -485,7 +485,7 @@ export class ProxyService {
stillWorking: successCount
});
} catch (error) {
this.logger.error('Error in health check', {error});
this.logger.error('Error in health check', error);
}
}, intervalMs);
}
@ -502,7 +502,7 @@ export class ProxyService {
this.logger.info('Cleared proxy stats from cache');
this.logger.warn('Full proxy data clearing not implemented due to cache provider limitations');
} catch (error) {
this.logger.error('Error clearing proxy data', {error});
this.logger.error('Error clearing proxy data', error);
}
}