Fix unhandled rejection (#504)

This commit is contained in:
alalamav 2019-09-20 15:02:12 -04:00 committed by GitHub
parent 20f81106ed
commit 57df4f9400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,11 @@ async function main() {
const metricsReader = new PrometheusUsageMetrics(prometheusClient);
const toMetricsId = (id: AccessKeyId) => {
return accessKeyRepository.getMetricsId(id);
try {
return accessKeyRepository.getMetricsId(id);
} catch (e) {
logging.warn(`Failed to get metrics id for access key ${id}: ${e}`);
}
};
const managerMetrics = new PrometheusManagerMetrics(prometheusClient);
const metricsCollector = new RestMetricsCollectorClient(metricsCollectorUrl);