code: func (h *NegotiationHandler) WriteError(w http.ResponseWriter, r *http.Request, err interface{}) {
  	switch httputil.NegotiateContentType(r, []string{}, "application/json") {
  	case "text/html":
  		h.html.WriteError(w, r, err)
  		return
  	case "text/plain":
  		h.plain.WriteError(w, r, err)
  		return
  	case "application/json":
  		h.json.WriteError(w, r, err)
  		return
  	default:
  		h.json.WriteError(w, r, err)
  		return
  	}
  }
docs: // WriteError writes an error to ResponseWriter and tries to extract the error's status code by
  // asserting statusCodeCarrier. If the error does not implement statusCodeCarrier, the status code
  // is set to 500.