code: func MakeErrorHandler(err error) http.HandlerFunc {
  	return func(w http.ResponseWriter, r *http.Request) {
  		statusCode := errdefs.GetHTTPErrorStatusCode(err)
  		vars := mux.Vars(r)
  		if apiVersionSupportsJSONErrors(vars["version"]) {
  			response := &types.ErrorResponse{
  				Message: err.Error(),
  			}
  			WriteJSON(w, statusCode, response)
  		} else {
  			http.Error(w, status.Convert(err).Message(), statusCode)
  		}
  	}
  }
docs: // MakeErrorHandler makes an HTTP handler that decodes a Docker error and
  // returns it in the response.