Skip to content

Commit fcb66a1

Browse files
piotrek6641patuwwy
authored andcommitted
try/catch validator
1 parent 11206de commit fcb66a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/monitoring-server/src/monitoring-server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ export class MonitoringServer implements IMonitoringServer {
1313
let ok = true;
1414

1515
if (this.options.validator) {
16-
ok = await this.options.validator();
16+
try {
17+
ok = await this.options.validator();
18+
} catch (_e) {
19+
res.statusCode = 500;
20+
res.end();
21+
}
1722
}
1823

1924
res.setHeader("Content-type", "text/plain");

0 commit comments

Comments
 (0)