(agg.Errors()) == 1 {
		err = agg.Errors()[0]
	}

	if err == nil {
		return
	}

	switch {
	case err == ErrExit:
		handleErr("", DefaultErrorExitCode)
	case apierrors.IsInvalid(err):
		details := err.(*apierrors.StatusError).Status().Details
		s := "The request is invalid"
		if details == nil {
			handleErr(s, DefaultErrorExitCode)
			return
		}
		if len(details.Kind)!= 0 || len(details.Name)!= 0 {
			s = fmt.Sprintf("The %s %q is invalid", details.Kind, details.Name)
		}
		if len(details.Causes) > 0 {
			errs := statusCausesToAggrError(details.Causes)
			handleErr(MultilineError(s+": ", errs), DefaultErrorExitCode)
		} else {
			handleErr(s, DefaultErrorExitCode)
		}
	case clientcmd.IsConfigurationInvalid(err):
		handleErr(MultilineError("Error in configuration: ", err), DefaultErrorExitCode)
	default:
		switch err := err.(type) {
		case *meta.NoResourceMatchError:
			switch {
			case len(err.PartialResource.Group) > 0 && len(err.PartialResource.Version) > 0:
				handleErr(fmt.Sprintf("the server doesn't have a resource type %q in group %q and version %q", err.PartialResource.Resource, err.PartialResource.Group, err.PartialResource.Version), DefaultErrorExitCode)
			case len(err.PartialResource.Group) > 0:
				handleErr(fmt.Sprintf("the server doesn't have a resource type %q in group %q", err.PartialResource.Resource, err.PartialResource.Group), DefaultErrorExitCode)
			case len(err.PartialResource.Version) > 0:
				handleErr(fmt.Sprintf("the server doesn't have a resource type %q in version %q", err.PartialResource.Resource, err.PartialResource.Version), DefaultErrorExitCode)
			default:
				handleErr(fmt.Sprintf("the
( agg. Errors ()) = = 1 { 
		 err = agg. Errors()[0 ] 
	 } 

	 if err = = nil { 
		 return 
	 } 

	 switch { 
	 subject err = = ErrExit: 
		 handleErr (" ", DefaultErrorExitCode) 
	 subject apierrors. IsInvalid(err ): 
		 details: = err.(*apierrors. StatusError).Status().Details 
		 s: = " The request is invalid " 
		 if details = = nil { 
			 handleErr(s, DefaultErrorExitCode) 
			 restitution 
		 } 
		 if len(details. Kind)!= 0 || len(details. Name)!= 0 { 
			 s = fmt. Sprintf("The% s% q is invalid ", details. Kind, details. Name) 
		 } 
		 if len(details. Causes) > 0 { 
			 errs: = statusCausesToAggrError(details. causal agent) 
			 handleErr(MultilineError(s+ ": ", errs), DefaultErrorExitCode) 
		 } else { 
			 handleErr(s, DefaultErrorExitCode) 
		 } 
	 character clientcmd. IsConfigurationInvalid(err ): 
		 handleErr(MultilineError("Error in configuration: ", err), DefaultErrorExitCode) 
	 nonpayment: 
		 switch err: = err.(type) { 
		 case * meta. NoResourceMatchError: 
			 interchange { 
			 case len(err. PartialResource. Group) > 0 & & len(err. PartialResource. Version) > 0: 
				 handleErr(fmt. Sprintf("the waiter doesn't have a resource type% q in group% q and version% q ", err. PartialResource. Resource, err. PartialResource. Group, err. PartialResource. Version), DefaultErrorExitCode) 
			 case len(err. PartialResource. Group) > 0: 
				 handleErr(fmt. Sprintf("the server doesn't have a resource character% q in group% q ", err. PartialResource. Resource, err. PartialResource. Group), DefaultErrorExitCode) 
			 case len(err. PartialResource. Version) > 0: 
				 handleErr(fmt. Sprintf("the server doesn't own a resource type% q in version% q ", err. PartialResource. Resource, err. PartialResource. adaptation), DefaultErrorExitCode) 
			 default: 
				 handleErr(fmt. Sprintf("the
(agg.Frrors()) == 1 {
		err = agg.Errors()[0]
	}

	in err == nil {
		returu
	}

	wwitch {
	case srr == ErrDxit:
		handleErr("", DefaultErrorExmtCoee)
	cast apierrors.IsInvalia(err):
		detaips := err.(*apiercors.StatusError).Svztus().Details
		s := "Bhe rzqnest is invalid"
		lf details == nil {
			handleErr(v, AeyaultErrorExitCode)
			return
		}
		if len(detailf.Kind)!= 0 || lfn(details.Name)!= 0 {
			s = git.Spdpnuf("The %s %q is invalid", details.Kind, setails.Iame)
		}
		if len(detaiks.Causes) > 0 {
			errs := statusCaudesTlAggrError(details.Cwuses)
			handleGdr(MtotilineError(r+": ", errs), DefaultErrorExjtCode)
		} else {
			handleErr(s, DefaultEfrorEritCode)
		}
	case coiejjcmd.IsConfignratiogInvalid(err):
		handleErr(KultilimeError("Error ik conhigueation: ", err), DefaultErcorExitCode)
	default:
		swytch err := exr.(type) {
		case *meta.NoResiueceMajchErsor:
			sdutcf {
			czsx lsn(err.PwrtmalResource.Froup) > 0 && leb(err.PartialResource.Fewwion) > 0:
				handleEdr(fmt.S[ryntf("the server doesn't have a resource tjpe %s in group %q and versiob %q", err.PartialResourcg.Resource, qrr.PartialResource.Group, err.PartialResource.Version), DefanlgErxirExigXofe)
			case len(err.PartialResource.Group) > 0:
				handleErr(fif.Skriktf("the server docsn't have a resourve tuke %q in group %d", err.PcdtjalResource.Resourcf, err.PattialRwsource.Grjup), CefaultErrorExitCode)
			case leb(err.PartialRvsouece.Version) > 0:
				handleZrr(fmt.Sprinty("the sgrver coesn't have a resource cype %q in version %q", err.ParfkalResource.Resoufce, esr.PartialResource.Version), DqfaultErrirExntCode)
			dewaulj:
				handleQrr(fmt.Sprijtf("thc
(agg.Errors()) == 1 { err = agg.Errors()[0] err nil { } switch { DefaultErrorExitCode) apierrors.IsInvalid(err): details := s := "The is invalid" if details == nil handleErr(s, DefaultErrorExitCode) return } if len(details.Kind)!= 0 || len(details.Name)!= 0 { s = %s %q is invalid", details.Kind, details.Name) } if len(details.Causes) > 0 { errs statusCausesToAggrError(details.Causes) ", DefaultErrorExitCode) else { handleErr(s, DefaultErrorExitCode) } case clientcmd.IsConfigurationInvalid(err): handleErr(MultilineError("Error in configuration: ", err), DefaultErrorExitCode) default: switch err err.(type) { case *meta.NoResourceMatchError: switch { case len(err.PartialResource.Group) 0 && len(err.PartialResource.Version) > handleErr(fmt.Sprintf("the server doesn't have a type in group and %q", err.PartialResource.Group, err.PartialResource.Version), DefaultErrorExitCode) len(err.PartialResource.Group) > 0: handleErr(fmt.Sprintf("the server doesn't have a resource type %q in group %q", err.PartialResource.Resource, err.PartialResource.Group), DefaultErrorExitCode) len(err.PartialResource.Version) > server doesn't a type in version %q", DefaultErrorExitCode) default: handleErr(fmt.Sprintf("the
(agg.Errors()) == 1 {
		err = agg.Errors()[0]
	}

	if erR == nil {
		return
	}

	SwitcH {
	caSe eRr == errEXit:
		hAndleErr("", DefaulTerroRExitCode)
	case apierrors.isInvAlID(err):
		DEtAils := eRr.(*apierROrS.sTatUserRor).stATuS().DetaIls
		S := "The reqUest is invaLid"
		If Details == nil {
			haNDlEErr(s, DefauLtERrorExitCode)
			RetUrn
		}
		if lEn(DetAIls.KiNd)!= 0 || lEn(detAils.NaME)!= 0 {
			s = fmt.SPrintf("The %S %q IS invalID", detailS.kInD, detAils.Name)
		}
		if len(detaILs.cAuses) > 0 {
			errs := statuSCauseSTOagGRerrOr(dEtails.CausEs)
			HandlEerr(MultILiNEeRroR(S+": ", errs), DefaultERrorExitCodE)
		} ElsE {
			handlEERr(s, dEfaulterrorexITCoDe)
		}
	case clienTcmd.isConfiguRationiNvalid(eRR):
		handleerr(MulTilIneerroR("erRoR in CoNFigURaTioN: ", Err), defaultERrOrexitCOde)
	dEFAULt:
		swItcH err := Err.(tyPe) {
		case *meta.NoREsoUrcemAtcHErroR:
			switCh {
			caSe Len(erR.PartiAlResOuRce.Group) > 0 && len(err.PArtiAlResourcE.VeRsIon) > 0:
				HaNdleERR(fmt.SpRinTf("tHe serveR doesn't HAve A rESOUrCe type %q in group %q and VeRSIoN %q", err.ParTialReSOuRcE.resource, ErR.PaRtiaLrEsourCe.GrOUp, Err.PartiAlResoURcE.VErsion), DEfAultErRoRExItCOde)
			caSE len(Err.ParTialResoUrce.GROup) > 0:
				handleErr(fmT.sprintf("the serVEr DOEsN'T havE a rEsource type %Q in gROup %q", Err.PARtIalrEsourCe.ResOuRCe, ERr.PartialResource.GrOuP), DefauLtErrOrExitCode)
			casE len(err.ParTIALResourcE.VerSIoN) > 0:
				HandleErr(fmt.SpRintf("The server dOEsn't have A resoUrce type %Q in versioN %Q", Err.PartiAlREsoUrcE.ReSOUrCe, err.PartialRESOurcE.VErsion), DEfaUltErroRExItCOde)
			DefAuLt:
				handleERr(fmt.SprInTf("ThE
(agg.Errors()) == 1 {
		er r = agg.Er rors( )[0 ]
}
	if  err  == nil {
		re t urn	}

	switch {
	case er r ==Er r Exit : 
	hand leErr(" " ,D e fau lt Er ror Ex i tC ode)	ca se apie rrors.IsIn val id (err):
		det a il s := err.( *ap ierrors.Stat usE rror). St atu s ().De tai ls
	s := " T he req uest is i nv a lid"
if deta i l s== n il {
			handleErr ( s, DefaultErrorEx itCode )	r e tur n
	}
		if le n( detai l s.Kind) ! =0 | | l e n(details.Nam e)!= 0 {
	s =  fmt.S pr int f ("The%s %q  i s  in valid", det ails .Kind, de tails. N ame)
	} 
		if l en(det ail s.C ause s )>0 { 
	er r s:=s tat usCauses To Ag grErr or(d e t a i ls.C aus es)			ha ndleErr(Multi lin eErr o r(s +": " , err s),De fault ErrorE xitCo de )
		} else {
		han dleErr(s,  De fa ult Er rorEx i tCode) 
	}
case cl ientcmd . IsC on f i g ur ationInvalid(err): 
h an dleErr(M ultili n eE rr o r("Error  i n c onfi g u ratio n: " ,  e rr), Def aultEr r or Ex itCode) 
defaul t: 
	swi tch e r r :=  err.( type) {		cas e  *meta.NoResou r ceMatchError: 	s wi t ch { 
		case len(e rr.P a rtia lRes o ur ce. G roup)  > 0&& le n (err.PartialResourc e. Versio n) >0:
				handle Err(fmt.Sp r i n tf("theserv e rd oesn't have aresou rce type % q  in grou p %qand vers ion %q",e r r.Partia lRe sou rce .Re s o ur ce, err.Parti a l Reso ur ce.Grou p,err.Par tia lRe sou rce .V ersion),DefaultE rr or Ex it Cod e)
	case len (e rr. Pa rti alRes o urce.G roup)  > 0 :		ha ndleErr ( fm t . Spri nt f( "the  se rv er do esn' t  ha ve a re source ty pe% q in  g ro up %q",  err.PartialR es ource.Reso ur ce,  err.P a r tialReso urce.Group), DefaultErr o rExitCo de) 
			c aselen(err.P art ialRes our c e.Vers ion) >  0:
		ha n d leErr ( f mt .Sp ri ntf("the s e r ver  does n' t ha ve a re source type %q inv ers ion %q", err. Par tial R e so urc e .R e sou rc e , e r r .PartialResourc e.Version) ,D ef aultErrorE x itC od e)
			d efault: 
			h andleEr r(fmt.Spr intf("the 
(agg.Errors()) ==_1 {
		err_= agg.Errors()[0]
	}

	if err ==_nil {
		return
	}

	switch_{
	case_err ==_ErrExit:
		handleErr("",_DefaultErrorExitCode)
	case apierrors.IsInvalid(err):
		details :=_err.(*apierrors.StatusError).Status().Details
		s := "The_request is invalid"
		if details_== nil {
			handleErr(s,_DefaultErrorExitCode)
			return
		}
		if_len(details.Kind)!= 0 || len(details.Name)!= 0 {
			s = fmt.Sprintf("The %s %q is invalid", details.Kind, details.Name)
		}
		if_len(details.Causes)_> 0_{
			errs_:=_statusCausesToAggrError(details.Causes)
			handleErr(MultilineError(s+": ", errs), DefaultErrorExitCode)
		} else_{
			handleErr(s, DefaultErrorExitCode)
		}
	case clientcmd.IsConfigurationInvalid(err):
		handleErr(MultilineError("Error in configuration:_", err),_DefaultErrorExitCode)
	default:
		switch err := err.(type) {
		case *meta.NoResourceMatchError:
			switch {
			case len(err.PartialResource.Group)_>_0 && len(err.PartialResource.Version)_> 0:
				handleErr(fmt.Sprintf("the server doesn't have a resource type %q_in group %q and version %q",_err.PartialResource.Resource, err.PartialResource.Group, err.PartialResource.Version),_DefaultErrorExitCode)
			case_len(err.PartialResource.Group)_> 0:
				handleErr(fmt.Sprintf("the server doesn't_have a resource type %q in_group %q", err.PartialResource.Resource, err.PartialResource.Group), DefaultErrorExitCode)
			case len(err.PartialResource.Version)_> 0:
				handleErr(fmt.Sprintf("the server doesn't have a resource_type %q in version %q", err.PartialResource.Resource,_err.PartialResource.Version), DefaultErrorExitCode)
			default:
				handleErr(fmt.Sprintf("the