errors.go 454 B

1234567891011121314151617181920212223
  1. package imagetype
  2. import (
  3. "net/http"
  4. "github.com/imgproxy/imgproxy/v3/ierrors"
  5. )
  6. type (
  7. UnknownFormatError struct{}
  8. )
  9. func newUnknownFormatError() error {
  10. return ierrors.Wrap(
  11. UnknownFormatError{},
  12. 1,
  13. ierrors.WithStatusCode(http.StatusUnprocessableEntity),
  14. ierrors.WithPublicMessage("Invalid source image"),
  15. ierrors.WithShouldReport(false),
  16. )
  17. }
  18. func (e UnknownFormatError) Error() string { return "Source image type not supported" }