mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-12-23 22:11:10 +02:00
* Refactored errors * Make monitoring and errorreport accept `errctx.Error` instead of `error` * Add server.Error; Remove category from errctx; Make HTTP handlers respond with *server.Error * Remove stackSkip from errctx.Wrap; Add errctx.WrapWithStackSkip
22 lines
394 B
Go
22 lines
394 B
Go
package svg
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/imgproxy/imgproxy/v3/errctx"
|
|
)
|
|
|
|
type (
|
|
SanitizeError struct{ *errctx.WrappedError }
|
|
)
|
|
|
|
func newSanitizeError(err error) error {
|
|
return SanitizeError{errctx.NewWrappedError(
|
|
err,
|
|
1,
|
|
errctx.WithStatusCode(http.StatusUnprocessableEntity),
|
|
errctx.WithPublicMessage("Broken or unsupported SVG image"),
|
|
errctx.WithShouldReport(true),
|
|
)}
|
|
}
|