1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-12-23 22:11:10 +02:00
Files
imgproxy/processing/svg/errors.go

24 lines
431 B
Go
Raw Permalink Normal View History

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 }