wrap errors correctly

This commit is contained in:
2026-07-07 09:34:36 +02:00
parent 24038e36f7
commit 2f77c27715
22 changed files with 95 additions and 94 deletions

View File

@@ -17,13 +17,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package es
import (
"errors"
"fmt"
"strings"
"github.com/elastic/go-elasticsearch/v9/typedapi/types"
)
func esErrorString(err error) string {
func esErrorString(err error) error {
msg := err.Error()
switch e := err.(type) {
@@ -42,5 +43,5 @@ func esErrorString(err error) string {
}
return msg
return errors.New(msg)
}