diff --git a/README.md b/README.md index e7ba3d39..89035b4c 100644 --- a/README.md +++ b/README.md @@ -1546,7 +1546,7 @@ endpoints: ``` The `[BODY]` placeholder contains the output of the query, and `[CONNECTED]` -shows whether the connected was successfully established. +shows whether the connection was successfully established. ### Monitoring an endpoint using ICMP By prefixing `endpoints[].url` with `icmp:\\`, you can monitor endpoints at a very basic level using ICMP, or more diff --git a/core/endpoint.go b/core/endpoint.go index b77352fa..866f1cd8 100644 --- a/core/endpoint.go +++ b/core/endpoint.go @@ -346,6 +346,10 @@ func (endpoint *Endpoint) call(result *Result) { } else if endpointType == EndpointTypeWS { result.Connected, result.Body, err = client.QueryWebSocket(endpoint.URL, endpoint.ClientConfig, endpoint.Body) result.Duration = time.Since(startTime) + if err != nil { + result.AddError(err.Error()) + return + } } else { response, err = client.GetHTTPClient(endpoint.ClientConfig).Do(request) result.Duration = time.Since(startTime)