user) { Db::transaction(function () use ($agent) { $agent->runAgentUpgradePlan(); }); } $job->delete(); } catch (HttpResponseException $e) { $data = $e->getResponse()->getData(); $message = $data ? ($data['msg'] ?? '') : $e->getMessage(); format_log_error($e, 'AgentUpgrade.HttpResponseException', $message); } catch (\Exception $e) { format_log_error($e, 'AgentUpgrade'); } } }