mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 17:14:17 +02:00
wrap errors correctly
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user