func (h *Handler) HandleError(w http.ResponseWriter, err error) {
	if err == nil {
		return
	}
	status := kivik.StatusCode(err)
	w.WriteHeader(status)
	wErr := json.NewEncoder(w).Encode(couchError{
		Error:  errorDescription(status),
		Reason: kivik.Reason(err),
	})
	if wErr != nil {
		h.Logger.Printf("Failed to send send error: %s", wErr)
	}
}
// HandleError returns a CouchDB-formatted error. It does nothing if err is nil.
HandleError returns a CouchDB-formatted error. It does nothing if err is nil.
// HandleError returns a CouchDB - formatted error . It does nothing if err is nil .
func (h *Handler) HandleError(w http.ResponseWriter, err error) {
	if err == nil {
		return
	}
	status := kivik.StatusCode(err)
	w.WriteHeader(status)
	wErr := json.NewEncoder(w).Encode(couchError{
		Error:  errorDescription(status),
		Reason: kivik.Reason(err),
	})
	if wErr != nil {
		h.Logger.Printf("Failed to send send error: %s", wErr)
	}
}
func ( h * Handler ) HandleError ( w http . ResponseWriter , err error ) { if err == nil { return } status := kivik . StatusCode ( err ) w . WriteHeader ( status ) wErr := json . NewEncoder ( w ) . Encode ( couchError { Error : errorDescription ( status ) , Reason : kivik . Reason ( err ) , } ) if wErr != nil { h . Logger . Printf ( " " , wErr ) } }
HandleError returns a CouchDB-formatted error.
HandleError returns a CouchDB - formatted error .