Feature/improve error log for data source request timeout (#2688)
* Improve error log for timeouts * Update changelog
This commit is contained in:
parent
52540d460b
commit
0a83bcd697
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- Improved the error log for a timeout in the data source request
|
||||||
- Improved the language localization for German (`de`)
|
- Improved the language localization for German (`de`)
|
||||||
- Upgraded `angular` from version `16.2.12` to `17.0.4`
|
- Upgraded `angular` from version `16.2.12` to `17.0.4`
|
||||||
- Upgraded `Nx` from version `17.0.2` to `17.1.3`
|
- Upgraded `Nx` from version `17.0.2` to `17.1.3`
|
||||||
|
@ -56,7 +56,13 @@ export class CoinGeckoService implements DataProviderInterface {
|
|||||||
|
|
||||||
response.name = name;
|
response.name = name;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error, 'CoinGeckoService');
|
let message = error;
|
||||||
|
|
||||||
|
if (error?.code === 'ABORT_ERR') {
|
||||||
|
message = `RequestError: The operation was aborted because the request to the data provider took more than ${DEFAULT_REQUEST_TIMEOUT}ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.error(message, 'CoinGeckoService');
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
@ -174,7 +180,13 @@ export class CoinGeckoService implements DataProviderInterface {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error, 'CoinGeckoService');
|
let message = error;
|
||||||
|
|
||||||
|
if (error?.code === 'ABORT_ERR') {
|
||||||
|
message = `RequestError: The operation was aborted because the request to the data provider took more than ${DEFAULT_REQUEST_TIMEOUT}ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.error(message, 'CoinGeckoService');
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
@ -216,7 +228,13 @@ export class CoinGeckoService implements DataProviderInterface {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error, 'CoinGeckoService');
|
let message = error;
|
||||||
|
|
||||||
|
if (error?.code === 'ABORT_ERR') {
|
||||||
|
message = `RequestError: The operation was aborted because the request to the data provider took more than ${DEFAULT_REQUEST_TIMEOUT}ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.error(message, 'CoinGeckoService');
|
||||||
}
|
}
|
||||||
|
|
||||||
return { items };
|
return { items };
|
||||||
|
@ -229,7 +229,13 @@ export class EodHistoricalDataService implements DataProviderInterface {
|
|||||||
|
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error, 'EodHistoricalDataService');
|
let message = error;
|
||||||
|
|
||||||
|
if (error?.code === 'ABORT_ERR') {
|
||||||
|
message = `RequestError: The operation was aborted because the request to the data provider took more than ${DEFAULT_REQUEST_TIMEOUT}ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.error(message, 'EodHistoricalDataService');
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
@ -382,7 +388,13 @@ export class EodHistoricalDataService implements DataProviderInterface {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error, 'EodHistoricalDataService');
|
let message = error;
|
||||||
|
|
||||||
|
if (error?.code === 'ABORT_ERR') {
|
||||||
|
message = `RequestError: The operation was aborted because the request to the data provider took more than ${DEFAULT_REQUEST_TIMEOUT}ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.error(message, 'EodHistoricalDataService');
|
||||||
}
|
}
|
||||||
|
|
||||||
return searchResult;
|
return searchResult;
|
||||||
|
@ -151,7 +151,13 @@ export class FinancialModelingPrepService implements DataProviderInterface {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error, 'FinancialModelingPrepService');
|
let message = error;
|
||||||
|
|
||||||
|
if (error?.code === 'ABORT_ERR') {
|
||||||
|
message = `RequestError: The operation was aborted because the request to the data provider took more than ${DEFAULT_REQUEST_TIMEOUT}ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.error(message, 'FinancialModelingPrepService');
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
@ -196,7 +202,13 @@ export class FinancialModelingPrepService implements DataProviderInterface {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error, 'FinancialModelingPrepService');
|
let message = error;
|
||||||
|
|
||||||
|
if (error?.code === 'ABORT_ERR') {
|
||||||
|
message = `RequestError: The operation was aborted because the request to the data provider took more than ${DEFAULT_REQUEST_TIMEOUT}ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.error(message, 'FinancialModelingPrepService');
|
||||||
}
|
}
|
||||||
|
|
||||||
return { items };
|
return { items };
|
||||||
|
@ -163,7 +163,13 @@ export class RapidApiService implements DataProviderInterface {
|
|||||||
|
|
||||||
return fgi;
|
return fgi;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error, 'RapidApiService');
|
let message = error;
|
||||||
|
|
||||||
|
if (error?.code === 'ABORT_ERR') {
|
||||||
|
message = `RequestError: The operation was aborted because the request to the data provider took more than ${DEFAULT_REQUEST_TIMEOUT}ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.error(message, 'RapidApiService');
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user