code: func FromObject(obj runtime.Object) error {
  	switch t := obj.(type) {
  	case *metav1.Status:
  		return &StatusError{ErrStatus: *t}
  	case runtime.Unstructured:
  		var status metav1.Status
  		obj := t.UnstructuredContent()
  		if !reflect.DeepEqual(obj["kind"], "Status") {
  			break
  		}
  		if err := runtime.DefaultUnstructuredConverter.FromUnstructured(t.UnstructuredContent(), &status); err != nil {
  			return err
  		}
  		if status.APIVersion != "v1" && status.APIVersion != "meta.k8s.io/v1" {
  			break
  		}
  		return &StatusError{ErrStatus: status}
  	}
  	return &UnexpectedObjectError{obj}
  }
docs: // FromObject generates an StatusError from an metav1.Status, if that is the type of obj; otherwise,
  // returns an UnexpecteObjectError.