MCPcopy Index your code
hub / github.com/writefreely/writefreely / handleTextError

Method handleTextError

handle.go:883–901  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, err error)

Source from the content-addressed store, hash-verified

881}
882
883func (h *Handler) handleTextError(w http.ResponseWriter, r *http.Request, err error) {
884 if err == nil {
885 return
886 }
887
888 if err, ok := err.(impart.HTTPError); ok {
889 if err.Status >= 300 && err.Status < 400 {
890 sendRedirect(w, err.Status, err.Message)
891 return
892 }
893
894 w.WriteHeader(err.Status)
895 fmt.Fprintf(w, http.StatusText(err.Status))
896 return
897 }
898
899 w.WriteHeader(http.StatusInternalServerError)
900 fmt.Fprintf(w, "This is an unhelpful error message for a miscellaneous internal error.")
901}
902
903func (h *Handler) handleOAuthError(w http.ResponseWriter, r *http.Request, err error) {
904 if err == nil {

Callers 1

PlainTextAPIMethod · 0.95

Calls 1

sendRedirectFunction · 0.85

Tested by

no test coverage detected