Browse Source

Improve error log output of data provider and queue services by omitting stack trace

pull/7622/head
Thomas Kaul 2 weeks ago
parent
commit
11bfb9b97a
  1. 12
      apps/api/src/app/endpoints/data-providers/ghostfolio/ghostfolio.service.ts
  2. 2
      apps/api/src/app/symbol/symbol.service.ts
  3. 4
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
  4. 6
      apps/api/src/services/data-provider/data-provider.service.ts
  5. 2
      apps/api/src/services/data-provider/google-sheets/google-sheets.service.ts
  6. 2
      apps/api/src/services/data-provider/manual/manual.service.ts
  7. 2
      apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts
  8. 6
      apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
  9. 4
      apps/api/src/services/queues/data-gathering/data-gathering.processor.ts
  10. 2
      apps/api/src/services/queues/data-gathering/data-gathering.service.ts
  11. 2
      apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts
  12. 8
      apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts

12
apps/api/src/app/endpoints/data-providers/ghostfolio/ghostfolio.service.ts

@ -115,7 +115,7 @@ export class GhostfolioService {
return result;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -157,7 +157,7 @@ export class GhostfolioService {
return result;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -199,7 +199,7 @@ export class GhostfolioService {
return result;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -226,7 +226,7 @@ export class GhostfolioService {
return marketDataOfMarkets;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -314,7 +314,7 @@ export class GhostfolioService {
return results;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -393,7 +393,7 @@ export class GhostfolioService {
return results;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}

2
apps/api/src/app/symbol/symbol.service.ts

@ -198,7 +198,7 @@ export class SymbolService {
results.items = items;
return results;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}

4
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts

@ -135,7 +135,7 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface {
response.url = url;
}
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
}
return response;
@ -280,7 +280,7 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface {
`No data found, ${aSymbol} (${this.getName()}) may be delisted`
);
} else {
this.logger.error(error);
this.logger.error(error.message);
}
}

6
apps/api/src/services/data-provider/data-provider.service.ts

@ -141,7 +141,7 @@ export class DataProviderService implements OnModuleInit {
);
}
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -427,7 +427,7 @@ export class DataProviderService implements OnModuleInit {
return r;
}, {});
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
} finally {
return response;
}
@ -548,7 +548,7 @@ export class DataProviderService implements OnModuleInit {
result[getAssetProfileIdentifier({ dataSource, symbol })] = data;
}
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}

2
apps/api/src/services/data-provider/google-sheets/google-sheets.service.ts

@ -144,7 +144,7 @@ export class GoogleSheetsService implements DataProviderInterface {
return response;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
}
return {};

2
apps/api/src/services/data-provider/manual/manual.service.ts

@ -215,7 +215,7 @@ export class ManualService implements DataProviderInterface {
return response;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
}
return {};

2
apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts

@ -113,7 +113,7 @@ export class RapidApiService implements DataProviderInterface {
}
}
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
}
return {};

6
apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts

@ -216,7 +216,7 @@ export class YahooFinanceService implements DataProviderInterface {
try {
quotes = await this.yahooFinance.quote(yahooFinanceSymbols);
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
this.logger.warn('Fallback to yahooFinance.quoteSummary()');
@ -244,7 +244,7 @@ export class YahooFinanceService implements DataProviderInterface {
return response;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
return {};
}
@ -352,7 +352,7 @@ export class YahooFinanceService implements DataProviderInterface {
if (error?.name === 'BadRequestError') {
this.logger.warn(`Could not search for "${query}": ${error.message}`);
} else {
this.logger.error(error);
this.logger.error(error.message);
}
}

4
apps/api/src/services/queues/data-gathering/data-gathering.processor.ts

@ -85,7 +85,7 @@ export class DataGatheringProcessor {
return job.discard();
}
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -198,7 +198,7 @@ export class DataGatheringProcessor {
return job.discard();
}
this.logger.error(error);
this.logger.error(error.message);
throw error;
}

2
apps/api/src/services/queues/data-gathering/data-gathering.service.ts

@ -322,7 +322,7 @@ export class DataGatheringService {
});
}
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
} finally {
return undefined;
}

2
apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts

@ -101,7 +101,7 @@ export class PortfolioSnapshotProcessor {
return snapshot;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw new Error(error);
}

8
apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts

@ -143,7 +143,7 @@ export class StatisticsGatheringProcessor {
return pull_count;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -173,7 +173,7 @@ export class StatisticsGatheringProcessor {
value
});
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -192,7 +192,7 @@ export class StatisticsGatheringProcessor {
return stargazers_count;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}
@ -221,7 +221,7 @@ export class StatisticsGatheringProcessor {
return data.attributes.availability / 100;
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
throw error;
}

Loading…
Cancel
Save