Fix error handling in loadUnmanagedContainers method
This commit is contained in:
parent
75b9f4fcbf
commit
0f4eab3cf2
@ -42,7 +42,11 @@ public function refreshStatus() {
|
||||
$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();
|
||||
|
@ -550,7 +550,6 @@ public function startUnmanaged($id)
|
||||
}
|
||||
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 @@ public function loadUnmanagedContainers()
|
||||
} else {
|
||||
return collect([]);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e);
|
||||
}
|
||||
|
||||
}
|
||||
public function hasDefinedResources()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user