Files
imgproxy/svg/errors.go
Victor Sokolov d47eeee6ad IMG-44: move skip to processing, remove imath.Min/Max (#1485)
* Removed imath.Min/Max

* Skip goes to processing

* no svg_processing error category

* should report SVG
2025-08-15 12:38:16 +02:00

24 lines
431 B
Go

package svg
import (
"net/http"
"github.com/imgproxy/imgproxy/v3/ierrors"
)
type (
SanitizeError struct{ error }
)
func newSanitizeError(err error) error {
return ierrors.Wrap(
SanitizeError{err},
1,
ierrors.WithStatusCode(http.StatusUnprocessableEntity),
ierrors.WithPublicMessage("Broken or unsupported SVG image"),
ierrors.WithShouldReport(true),
)
}
func (e SanitizeError) Unwrap() error { return e.error }