errors.go 292 B

123456789101112131415161718
  1. package options
  2. import (
  3. "fmt"
  4. "github.com/imgproxy/imgproxy/v3/ierrors"
  5. )
  6. type (
  7. TypeMismatchError struct{ error }
  8. )
  9. func newTypeMismatchError(key string, exp, got any) error {
  10. return ierrors.Wrap(
  11. TypeMismatchError{fmt.Errorf("option %s is %T, not %T", key, exp, got)},
  12. 1,
  13. )
  14. }