Skip to content

Commit

Permalink
fix: error handle server listen promise
Browse files Browse the repository at this point in the history
Signed-off-by: naseemkullah <[email protected]>
  • Loading branch information
naseemkullah committed Jan 25, 2021
1 parent 5a82115 commit 8021341
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class PrometheusExporter implements MetricExporter {
};

private readonly _logger: api.Logger;
private readonly _host: string;
private readonly _host?: string;
private readonly _port: number;
private readonly _endpoint: string;
private readonly _server: Server;
Expand Down Expand Up @@ -74,7 +74,7 @@ export class PrometheusExporter implements MetricExporter {
).replace(/^([^/])/, '/$1');

if (config.preventServerStart !== true) {
this.startServer().then(callback);
this.startServer().then(callback).catch(err => this._logger.error(err));
} else if (callback) {
callback();
}
Expand Down

0 comments on commit 8021341

Please sign in to comment.