1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-12-04 09:42:31 +02:00
imgproxy/metrics/errformat/errformat.go
2022-10-06 15:08:23 +06:00

19 lines
307 B
Go

package errformat
import (
"fmt"
"reflect"
"github.com/imgproxy/imgproxy/v3/ierrors"
)
func FormatErrType(errType string, err error) string {
errType += "_error"
if _, ok := err.(*ierrors.Error); !ok {
errType = fmt.Sprintf("%s (%s)", errType, reflect.TypeOf(err).String())
}
return errType
}