(w http.ResponseWriter, r *http.Request, err error)
| 881 | } |
| 882 | |
| 883 | func (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 | |
| 903 | func (h *Handler) handleOAuthError(w http.ResponseWriter, r *http.Request, err error) { |
| 904 | if err == nil { |
no test coverage detected