From 9053a3880dbf67da336aeb15d4eef1f6a940af7b Mon Sep 17 00:00:00 2001 From: Jiyong Huang Date: Mon, 23 Dec 2024 09:12:50 +0800 Subject: [PATCH] fix(rest): add recoverable error message Signed-off-by: Jiyong Huang --- pkg/errorx/errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/errorx/errors.go b/pkg/errorx/errors.go index da15b1240d..321e867f74 100644 --- a/pkg/errorx/errors.go +++ b/pkg/errorx/errors.go @@ -1,4 +1,4 @@ -// Copyright 2021-2023 EMQ Technologies Co., Ltd. +// Copyright 2021-2024 EMQ Technologies Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ type ErrorWithCode interface { } func IsRecoverAbleError(err error) bool { - if strings.Contains(err.Error(), "connection reset by peer") { + if strings.Contains(err.Error(), "connection reset by peer") || strings.Contains(err.Error(), "No connection could be made") { return true } if urlErr, ok := err.(*url.Error); ok {