From 33ce0ef02c8ad1e660d253020cb8d01d9e829188 Mon Sep 17 00:00:00 2001 From: Nelson Chan <3271800+chakflying@users.noreply.github.com> Date: Tue, 21 Nov 2023 23:56:17 +0800 Subject: [PATCH] Fix: Improve error message on timeout (#4054) * Fix: Improve error message on timeout * Chore: Format --- server/model/monitor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index f7cbff303..8958e3d80 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -938,7 +938,11 @@ class Monitor extends BeanModel { } catch (error) { - bean.msg = error.message; + if (error?.name === "CanceledError") { + bean.msg = `timeout by AbortSignal (${this.timeout}s)`; + } else { + bean.msg = error.message; + } // If UP come in here, it must be upside down mode // Just reset the retries