Resolve "Transition to ESLint"

This commit is contained in:
Thea Schöbl
2022-06-27 14:40:09 +00:00
committed by Rainer Killinger
parent ca1d2444e0
commit 418ba67d15
47 changed files with 1854 additions and 1634 deletions

View File

@@ -24,9 +24,9 @@ type UserOptions = Parameters<typeof expressPrometheusMiddleware>[0];
* Create and configure a new Express Prometheus Middleware instance
*
* This function tries to configure the new instance with JSON read from
* `./conf/prometheus.json`. When this fails an instance configured with
* `./conf/prometheus.json`. When this fails an instance configured with
* default options is returned.
*
*
* @returns express.Express
*/
export function getPrometheusMiddleware(): express.Express {
@@ -34,9 +34,9 @@ export function getPrometheusMiddleware(): express.Express {
let options: UserOptions = {};
try {
options = JSON.parse(fs.readFileSync(configFileName, 'utf-8'));
} catch(err) {
Logger.warn('Could not get options for Prometheus Middleware.', err);
options = JSON.parse(fs.readFileSync(configFileName, 'utf8'));
} catch (error) {
Logger.warn('Could not get options for Prometheus Middleware.', error);
}
return expressPrometheusMiddleware(options);