refactor: improve error report message

This commit is contained in:
moonrailgun 2023-12-29 20:21:52 +08:00
parent 6c266fdb5f
commit 1f950b516e

View File

@ -119,7 +119,7 @@ class MonitorManager {
this.monitorRunner[m.id] = runner; this.monitorRunner[m.id] = runner;
await runner.startMonitor(); await runner.startMonitor();
} catch (err) { } catch (err) {
console.error('Start monitor error:', err); console.error('Start monitor error:', String(err));
} }
}) })
).then(() => { ).then(() => {
@ -171,7 +171,7 @@ class MonitorRunner {
try { try {
value = await provider.run(monitor); value = await provider.run(monitor);
} catch (err) { } catch (err) {
console.error(err); logger.error('[Monitor] run error:', String(err));
value = -1; value = -1;
} }