mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-12-04 09:42:31 +02:00
19 lines
307 B
Go
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
|
|
}
|