2025-08-15 12:38:16 +02:00
|
|
|
package svg
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
|
2025-11-20 01:26:21 +06:00
|
|
|
"github.com/imgproxy/imgproxy/v3/errctx"
|
2025-08-15 12:38:16 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type (
|
2025-11-20 01:26:21 +06:00
|
|
|
SanitizeError struct{ *errctx.WrappedError }
|
2025-08-15 12:38:16 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func newSanitizeError(err error) error {
|
2025-11-20 01:26:21 +06:00
|
|
|
return SanitizeError{errctx.NewWrappedError(
|
|
|
|
|
err,
|
2025-08-15 12:38:16 +02:00
|
|
|
1,
|
2025-11-20 01:26:21 +06:00
|
|
|
errctx.WithStatusCode(http.StatusUnprocessableEntity),
|
|
|
|
|
errctx.WithPublicMessage("Broken or unsupported SVG image"),
|
|
|
|
|
errctx.WithShouldReport(true),
|
|
|
|
|
)}
|
2025-08-15 12:38:16 +02:00
|
|
|
}
|