errors.go 557 B

12345678910111213141516171819202122232425
  1. package processing
  2. import (
  3. "fmt"
  4. "net/http"
  5. "github.com/imgproxy/imgproxy/v3/ierrors"
  6. "github.com/imgproxy/imgproxy/v3/imagetype"
  7. )
  8. type (
  9. SaveFormatError string
  10. )
  11. func newSaveFormatError(format imagetype.Type) error {
  12. return ierrors.Wrap(
  13. SaveFormatError(fmt.Sprintf("Can't save %s, probably not supported by your libvips", format)),
  14. 1,
  15. ierrors.WithStatusCode(http.StatusUnprocessableEntity),
  16. ierrors.WithPublicMessage("Invalid URL"),
  17. ierrors.WithShouldReport(false),
  18. )
  19. }
  20. func (e SaveFormatError) Error() string { return string(e) }