diff --git a/app/Livewire/Server/Resources.php b/app/Livewire/Server/Resources.php index f781418d9..1c8a8267e 100644 --- a/app/Livewire/Server/Resources.php +++ b/app/Livewire/Server/Resources.php @@ -42,7 +42,11 @@ class Resources extends Component $this->dispatch('success', 'Resource statuses refreshed.'); } public function loadUnmanagedContainers() { - $this->unmanagedContainers = $this->server->loadUnmanagedContainers(); + try { + $this->unmanagedContainers = $this->server->loadUnmanagedContainers(); + } catch (\Throwable $e) { + return handleError($e, $this); + } } public function mount() { $this->unmanagedContainers = collect(); diff --git a/app/Models/Server.php b/app/Models/Server.php index 10af2915d..cbe895936 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -550,7 +550,6 @@ $schema://$host { } public function loadUnmanagedContainers() { - try { if ($this->isFunctional()) { $containers = instant_remote_process(["docker ps -a --format '{{json .}}' "], $this); $containers = format_docker_command_output_to_json($containers); @@ -566,10 +565,6 @@ $schema://$host { } else { return collect([]); } - } catch (\Throwable $e) { - return handleError($e); - } - } public function hasDefinedResources() {