throw error if present
This commit is contained in:
1 parent
06f49e24c2
commit
4e78de9da2
1 file changed
+3
@@ -75,6 +75,9 @@ class NetworkService {
|
|||||||
const { response, responseTime, error } = await this.timeRequest(() => this.ping.promise.probe(monitor.url));
|
const { response, responseTime, error } = await this.timeRequest(() => this.ping.promise.probe(monitor.url));
|
||||||
|
|
||||||
if (!response) {
|
if (!response) {
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
throw new Error("Ping failed - no result returned");
|
throw new Error("Ping failed - no result returned");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user