Browse Source

Feature/harmonize log messages in data provider services (#4064)

* Harmonize log messages
pull/4066/head
Thomas Kaul 2 months ago
committed by GitHub
parent
commit
0bc52fd80e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      apps/api/src/services/data-provider/coingecko/coingecko.service.ts
  2. 6
      apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts
  3. 6
      apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts
  4. 6
      apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts

12
apps/api/src/services/data-provider/coingecko/coingecko.service.ts

@ -86,9 +86,9 @@ export class CoinGeckoService implements DataProviderInterface {
let message = error; let message = error;
if (error?.code === 'ABORT_ERR') { if (error?.code === 'ABORT_ERR') {
message = `RequestError: The operation to get the asset profile for ${symbol} was aborted because the request to the data provider took more than ${this.configurationService.get( message = `RequestError: The operation to get the asset profile for ${symbol} was aborted because the request to the data provider took more than ${(
'REQUEST_TIMEOUT' this.configurationService.get('REQUEST_TIMEOUT') / 1000
)}ms`; ).toFixed(3)} seconds`;
} }
Logger.error(message, 'CoinGeckoService'); Logger.error(message, 'CoinGeckoService');
@ -255,9 +255,9 @@ export class CoinGeckoService implements DataProviderInterface {
let message = error; let message = error;
if (error?.code === 'ABORT_ERR') { if (error?.code === 'ABORT_ERR') {
message = `RequestError: The operation to search for ${query} was aborted because the request to the data provider took more than ${this.configurationService.get( message = `RequestError: The operation to search for ${query} was aborted because the request to the data provider took more than ${(
'REQUEST_TIMEOUT' this.configurationService.get('REQUEST_TIMEOUT') / 1000
)}ms`; ).toFixed(3)} seconds`;
} }
Logger.error(message, 'CoinGeckoService'); Logger.error(message, 'CoinGeckoService');

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

@ -454,9 +454,9 @@ export class EodHistoricalDataService implements DataProviderInterface {
let message = error; let message = error;
if (error?.code === 'ABORT_ERR') { if (error?.code === 'ABORT_ERR') {
message = `RequestError: The operation to search for ${aQuery} was aborted because the request to the data provider took more than ${this.configurationService.get( message = `RequestError: The operation to search for ${aQuery} was aborted because the request to the data provider took more than ${(
'REQUEST_TIMEOUT' this.configurationService.get('REQUEST_TIMEOUT') / 1000
)}ms`; ).toFixed(3)} seconds`;
} }
Logger.error(message, 'EodHistoricalDataService'); Logger.error(message, 'EodHistoricalDataService');

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

@ -204,9 +204,9 @@ export class FinancialModelingPrepService implements DataProviderInterface {
let message = error; let message = error;
if (error?.code === 'ABORT_ERR') { if (error?.code === 'ABORT_ERR') {
message = `RequestError: The operation to search for ${query} was aborted because the request to the data provider took more than ${this.configurationService.get( message = `RequestError: The operation to search for ${query} was aborted because the request to the data provider took more than ${(
'REQUEST_TIMEOUT' this.configurationService.get('REQUEST_TIMEOUT') / 1000
)}ms`; ).toFixed(3)} seconds`;
} }
Logger.error(message, 'FinancialModelingPrepService'); Logger.error(message, 'FinancialModelingPrepService');

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

@ -159,9 +159,9 @@ export class RapidApiService implements DataProviderInterface {
let message = error; let message = error;
if (error?.code === 'ABORT_ERR') { if (error?.code === 'ABORT_ERR') {
message = `RequestError: The operation was aborted because the request to the data provider took more than ${this.configurationService.get( message = `RequestError: The operation was aborted because the request to the data provider took more than ${(
'REQUEST_TIMEOUT' this.configurationService.get('REQUEST_TIMEOUT') / 1000
)}ms`; ).toFixed(3)} seconds`;
} }
Logger.error(message, 'RapidApiService'); Logger.error(message, 'RapidApiService');

Loading…
Cancel
Save