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

Function newRequestSchemeError

fetcher/errors.go:53–68  ·  view source on GitHub ↗
(scheme string)

Source from the content-addressed store, hash-verified

51const schemeDocsUrl = "https://docs.imgproxy.net/configuration/options#"
52
53func newRequestSchemeError(scheme string) error {
54 msg := fmt.Sprintf("unknown scheme: %s", scheme)
55
56 opts := []errctx.Option{
57 errctx.WithStatusCode(http.StatusNotFound),
58 errctx.WithPublicMessage(msgSourceIsUnreachable),
59 errctx.WithShouldReport(false),
60 }
61
62 if envVar, ok := schemeEnvVars[scheme]; ok {
63 msg = fmt.Sprintf("unknown scheme: %s (set %s to enable)", scheme, envVar)
64 opts = append(opts, errctx.WithDocsURL(schemeDocsUrl+envVar))
65 }
66
67 return RequstSchemeError{errctx.NewTextError(msg, 1, opts...)}
68}
69
70func newPartialResponseError(msg string) error {
71 return PartialResponseError{errctx.NewTextError(

Callers 1

BuildRequestMethod · 0.85

Calls 5

WithStatusCodeFunction · 0.92
WithPublicMessageFunction · 0.92
WithShouldReportFunction · 0.92
WithDocsURLFunction · 0.92
NewTextErrorFunction · 0.92

Tested by

no test coverage detected