Browse Source

Task/improve error log output of data provider and queue services (#7622)

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

* Update changelog
pull/7628/head
Thomas Kaul 4 days ago
committed by GitHub
parent
commit
92475c0b8b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 12
      apps/api/src/app/endpoints/data-providers/ghostfolio/ghostfolio.service.ts
  3. 2
      apps/api/src/app/symbol/symbol.service.ts
  4. 4
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
  5. 6
      apps/api/src/services/data-provider/data-provider.service.ts
  6. 2
      apps/api/src/services/data-provider/google-sheets/google-sheets.service.ts
  7. 2
      apps/api/src/services/data-provider/manual/manual.service.ts
  8. 2
      apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts
  9. 6
      apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
  10. 4
      apps/api/src/services/queues/data-gathering/data-gathering.processor.ts
  11. 2
      apps/api/src/services/queues/data-gathering/data-gathering.service.ts
  12. 2
      apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.processor.ts
  13. 8
      apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts

1
CHANGELOG.md

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Simplified the error log output of the data provider and queue services by omitting the stack trace
- Improved the language localization for German (`de`)
### Fixed

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

@ -136,7 +136,7 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface {
response.url = url;
}
} catch (error) {
this.logger.error(error);
this.logger.error(error.message);
}
return response;
@ -281,7 +281,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