1
0

errors.go 431 B

1234567891011121314151617181920212223
  1. package svg
  2. import (
  3. "net/http"
  4. "github.com/imgproxy/imgproxy/v3/ierrors"
  5. )
  6. type (
  7. SanitizeError struct{ error }
  8. )
  9. func newSanitizeError(err error) error {
  10. return ierrors.Wrap(
  11. SanitizeError{err},
  12. 1,
  13. ierrors.WithStatusCode(http.StatusUnprocessableEntity),
  14. ierrors.WithPublicMessage("Broken or unsupported SVG image"),
  15. ierrors.WithShouldReport(true),
  16. )
  17. }
  18. func (e SanitizeError) Unwrap() error { return e.error }