diff --git a/Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts b/Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts index b10a3043a6a..bb85f74ada7 100644 --- a/Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts +++ b/Probe/Utils/Monitors/MonitorTypes/ApiMonitor.ts @@ -189,8 +189,6 @@ export default class ApiMonitor { return await this.ping(url, options); } - - if (!options.isOnlineCheckRequest) { if (!(await ApiMonitor.isProbeOnline())) { logger.error( @@ -213,8 +211,8 @@ export default class ApiMonitor { failureCause: (err as any).toString(), }; - // check if timeout exceeded and if yes, return null - if ( + // check if timeout exceeded and if yes, return null + if ( (err as any).toString().includes('timeout') && (err as any).toString().includes('exceeded') ) { diff --git a/Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts b/Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts index c23db33da55..5d78e905990 100644 --- a/Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts +++ b/Probe/Utils/Monitors/MonitorTypes/PingMonitor.ts @@ -147,7 +147,7 @@ export default class PingMonitor { logger.info( `Ping Monitor - Timeout exceeded ${pingOptions.monitorId?.toString()} ${host.toString()} - ERROR: ${err}` ); - + return { isOnline: false, failureCause: 'Timeout exceeded',