@@ -180,13 +180,13 @@ func (r *ServiceBindingReconciler) Reconcile(ctx context.Context, req ctrl.Reque
180180
181181 smClient , err := r .getSMClient (ctx , serviceBinding , serviceInstance .Spec .BTPAccessCredentialsSecret )
182182 if err != nil {
183- return r .markAsTransientError (ctx , Unknown , err . Error () , serviceBinding )
183+ return r .markAsTransientError (ctx , Unknown , err , serviceBinding )
184184 }
185185
186186 smBinding , err := r .getBindingForRecovery (ctx , smClient , serviceBinding )
187187 if err != nil {
188188 log .Error (err , "failed to check binding recovery" )
189- return r .markAsTransientError (ctx , smClientTypes .CREATE , err . Error () , serviceBinding )
189+ return r .markAsTransientError (ctx , smClientTypes .CREATE , err , serviceBinding )
190190 }
191191 if smBinding != nil {
192192 return r .recover (ctx , serviceBinding , smBinding )
@@ -275,7 +275,7 @@ func (r *ServiceBindingReconciler) delete(ctx context.Context, serviceBinding *s
275275 if controllerutil .ContainsFinalizer (serviceBinding , api .FinalizerName ) {
276276 smClient , err := r .getSMClient (ctx , serviceBinding , btpAccessCredentialsSecret )
277277 if err != nil {
278- return r .markAsTransientError (ctx , Unknown , err . Error () , serviceBinding )
278+ return r .markAsTransientError (ctx , Unknown , err , serviceBinding )
279279 }
280280
281281 if len (serviceBinding .Status .BindingID ) == 0 {
@@ -338,7 +338,7 @@ func (r *ServiceBindingReconciler) poll(ctx context.Context, serviceBinding *ser
338338
339339 smClient , err := r .getSMClient (ctx , serviceBinding , btpAccessCredentialsSecret )
340340 if err != nil {
341- return r .markAsTransientError (ctx , Unknown , err . Error () , serviceBinding )
341+ return r .markAsTransientError (ctx , Unknown , err , serviceBinding )
342342 }
343343
344344 status , statusErr := smClient .Status (serviceBinding .Status .OperationURL , nil )
@@ -359,7 +359,7 @@ func (r *ServiceBindingReconciler) poll(ctx context.Context, serviceBinding *ser
359359 }
360360
361361 if status == nil {
362- return r .markAsTransientError (ctx , serviceBinding .Status .OperationType , fmt .Sprintf ("failed to get last operation status of %s" , serviceBinding .Name ), serviceBinding )
362+ return r .markAsTransientError (ctx , serviceBinding .Status .OperationType , fmt .Errorf ("failed to get last operation status of %s" , serviceBinding .Name ), serviceBinding )
363363 }
364364 switch status .State {
365365 case smClientTypes .INPROGRESS :
@@ -708,7 +708,7 @@ func (r *ServiceBindingReconciler) handleSecretError(ctx context.Context, op smC
708708 if apierrors .ReasonForError (err ) == metav1 .StatusReasonUnknown {
709709 return r .markAsNonTransientError (ctx , op , err .Error (), binding )
710710 }
711- return r .markAsTransientError (ctx , op , err . Error () , binding )
711+ return r .markAsTransientError (ctx , op , err , binding )
712712}
713713
714714func (r * ServiceBindingReconciler ) addInstanceInfo (ctx context.Context , binding * servicesv1.ServiceBinding , credentialsMap map [string ][]byte ) ([]SecretMetadataProperty , error ) {
0 commit comments