code: func (r Result) Error() error {
  	// if we have received an unexpected server error, and we have a body and decoder, we can try to extract
  	// a Status object.
  	if r.err == nil || !errors.IsUnexpectedServerError(r.err) || len(r.body) == 0 || r.decoder == nil {
  		return r.err
  	}
  
  	// attempt to convert the body into a Status object
  	// to be backwards compatible with old servers that do not return a version, default to "v1"
  	out, _, err := r.decoder.Decode(r.body, &schema.GroupVersionKind{Version: "v1"}, nil)
  	if err != nil {
  		klog.V(5).Infof("body was not decodable (unable to check for Status): %v", err)
  		return r.err
  	}
  	switch t := out.(type) {
  	case *metav1.Status:
  		// because we default the kind, we *must* check for StatusFailure
  		if t.Status == metav1.StatusFailure {
  			return errors.FromObject(t)
  		}
  	}
  	return r.err
  }
docs: // Error returns the error executing the request, nil if no error occurred.
  // If the returned object is of type Status and has Status != StatusSuccess, the
  // additional information in Status will be used to enrich the error.
  // See the Request.Do() comment for what errors you might get.