code: func (h *JSONWriter) WriteError(w http.ResponseWriter, r *http.Request, err interface{}) {
  	if s, ok := errors.Cause(toError(err)).(statusCodeCarrier); ok {
  		h.WriteErrorCode(w, r, s.StatusCode(), err)
  		return
  	}
  
  	h.WriteErrorCode(w, r, http.StatusInternalServerError, 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.