diff --git a/cmd/jujud/agent/machine.go b/cmd/jujud/agent/machine.go
index <HASH>..<HASH> 100644
--- a/cmd/jujud/agent/machine.go
+++ b/cmd/jujud/agent/machine.go
@@ -672,20 +672,6 @@ func (a *MachineAgent) APIWorker() (_ worker.Worker, err error) {
 	}
 	reportOpenedAPI(st)
 
-	defer func() {
-		// TODO(fwereade): this is not properly tested. Old tests were evil
-		// (dependent on injecting an error in a patched-out upgrader API
-		// that shouldn't even be used at this level)... so I just deleted
-		// them. Not a major worry: this whole method will become redundant
-		// when we switch to the dependency engine (and specifically use
-		// worker/apicaller to connect).
-		if err != nil {
-			if err := st.Close(); err != nil {
-				logger.Errorf("while closing API: %v", err)
-			}
-		}
-	}()
-
 	// All other workers must wait for the upgrade steps to complete before starting.
 	runner := newConnRunner(st)
 	a.startWorkerAfterUpgrade(runner, "api-post-upgrade", func() (worker.Worker, error) {
cmd/jujud/agent: Remove now-unnecessary error handling

This func no longer returns an error so closing the API connection on
error is no longer necessary.