(w http.ResponseWriter, r *http.Request, _ Handler)
| 95 | } |
| 96 | |
| 97 | func (e StaticError) ServeHTTP(w http.ResponseWriter, r *http.Request, _ Handler) error { |
| 98 | repl := r.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer) |
| 99 | |
| 100 | statusCode := http.StatusInternalServerError |
| 101 | if codeStr := e.StatusCode.String(); codeStr != "" { |
| 102 | intVal, err := strconv.Atoi(repl.ReplaceAll(codeStr, "")) |
| 103 | if err != nil { |
| 104 | return Error(http.StatusInternalServerError, err) |
| 105 | } |
| 106 | statusCode = intVal |
| 107 | } |
| 108 | return Error(statusCode, fmt.Errorf("%s", repl.ReplaceKnown(e.Error, ""))) |
| 109 | } |
| 110 | |
| 111 | // Interface guard |
| 112 | var ( |
nothing calls this directly
no test coverage detected