2025-10-24 23:34:05 +03:00
|
|
|
package xmlparser
|
2025-10-21 20:52:16 +03:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"net/http"
|
|
|
|
|
|
2025-11-19 23:54:32 +03:00
|
|
|
"github.com/imgproxy/imgproxy/v3/errctx"
|
2025-10-21 20:52:16 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type (
|
2025-11-19 23:54:32 +03:00
|
|
|
SyntaxError struct{ *errctx.TextError }
|
2025-10-21 20:52:16 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func newSyntaxError(msg string, args ...any) error {
|
2025-11-19 23:54:32 +03:00
|
|
|
return SyntaxError{errctx.NewTextError(
|
|
|
|
|
fmt.Sprintf(msg, args...),
|
2025-10-21 20:52:16 +03:00
|
|
|
1,
|
2025-11-19 23:54:32 +03:00
|
|
|
errctx.WithPublicMessage("SVG syntax error"),
|
|
|
|
|
errctx.WithStatusCode(http.StatusUnprocessableEntity),
|
|
|
|
|
)}
|
2025-10-21 20:52:16 +03:00
|
|
|
}
|