Skip to content

Commit e8cba6c

Browse files
authored
crossplane: remove unnecessary error handling in Update (#85)
Description of changes: Remove unnecessary error handling in Update because it's already handled in return statement. Manually tested. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 818c022 commit e8cba6c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

templates/crossplane/pkg/controller.go.tpl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,7 @@ func (e *external) Update(ctx context.Context, mg cpresource.Managed) (managed.E
143143
return managed.ExternalUpdate{}, errors.Wrap(err, "pre-update failed")
144144
}
145145
resp, err := e.client.{{ .CRD.Ops.Update.ExportedName }}WithContext(ctx, input)
146-
if err != nil {
147-
return managed.ExternalUpdate{}, awsclient.Wrap(err, errUpdate)
148-
}
149-
return e.postUpdate(ctx, cr, resp, managed.ExternalUpdate{}, err)
146+
return e.postUpdate(ctx, cr, resp, managed.ExternalUpdate{}, awsclient.Wrap(err, errUpdate))
150147
{{- else }}
151148
return e.update(ctx, mg)
152149
{{ end }}

0 commit comments

Comments
 (0)