Skip to content

Commit

Permalink
Refactor PortMonitor to resolve with PositiveNumber on ping timeout i…
Browse files Browse the repository at this point in the history
…nstead of rejecting with UnableToReachServer
  • Loading branch information
simlarsen committed Sep 24, 2024
1 parent e5dcec6 commit 1d0e782
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Probe/Utils/Monitors/MonitorTypes/PortMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import OnlineCheck from "../../OnlineCheck";
import Hostname from "Common/Types/API/Hostname";
import URL from "Common/Types/API/URL";
import BadDataException from "Common/Types/Exception/BadDataException";
import UnableToReachServer from "Common/Types/Exception/UnableToReachServer";
import { PromiseRejectErrorFunction } from "Common/Types/FunctionTypes";
import IPv4 from "Common/Types/IP/IPv4";
import IPv6 from "Common/Types/IP/IPv6";
Expand Down Expand Up @@ -115,7 +114,7 @@ export default class PortMonitor {
logger.debug("Ping timeout");

if (!hasPromiseResolved) {
reject(new UnableToReachServer("Ping timeout"));
resolve(new PositiveNumber(timeout));
}

hasPromiseResolved = true;
Expand Down

0 comments on commit 1d0e782

Please sign in to comment.