(scheme string)
| 51 | const schemeDocsUrl = "https://docs.imgproxy.net/configuration/options#" |
| 52 | |
| 53 | func 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 | |
| 70 | func newPartialResponseError(msg string) error { |
| 71 | return PartialResponseError{errctx.NewTextError( |
no test coverage detected