MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / newVipsError

Function newVipsError

vips/errors.go:19–33  ·  view source on GitHub ↗
(msg string)

Source from the content-addressed store, hash-verified

17type VipsError struct{ *errctx.TextError }
18
19func newVipsError(msg string) error {
20 var opts []errctx.Option
21
22 for _, re := range badImageErrRe {
23 if re.MatchString(msg) {
24 opts = []errctx.Option{
25 errctx.WithStatusCode(http.StatusUnprocessableEntity),
26 errctx.WithPublicMessage("Broken or unsupported image"),
27 }
28 break
29 }
30 }
31
32 return VipsError{errctx.NewTextError(msg, 1, opts...)}
33}

Callers 5

InitFunction · 0.85
ErrorFunction · 0.85
LoadMethod · 0.85
LoadThumbnailMethod · 0.85
SaveMethod · 0.85

Calls 3

WithStatusCodeFunction · 0.92
WithPublicMessageFunction · 0.92
NewTextErrorFunction · 0.92

Tested by

no test coverage detected