Fix error handling in loadUnmanagedContainers method
This commit is contained in:
@@ -42,7 +42,11 @@ class Resources extends Component
|
|||||||
$this->dispatch('success', 'Resource statuses refreshed.');
|
$this->dispatch('success', 'Resource statuses refreshed.');
|
||||||
}
|
}
|
||||||
public function loadUnmanagedContainers() {
|
public function loadUnmanagedContainers() {
|
||||||
|
try {
|
||||||
$this->unmanagedContainers = $this->server->loadUnmanagedContainers();
|
$this->unmanagedContainers = $this->server->loadUnmanagedContainers();
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
return handleError($e, $this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public function mount() {
|
public function mount() {
|
||||||
$this->unmanagedContainers = collect();
|
$this->unmanagedContainers = collect();
|
||||||
|
|||||||
@@ -550,7 +550,6 @@ $schema://$host {
|
|||||||
}
|
}
|
||||||
public function loadUnmanagedContainers()
|
public function loadUnmanagedContainers()
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
if ($this->isFunctional()) {
|
if ($this->isFunctional()) {
|
||||||
$containers = instant_remote_process(["docker ps -a --format '{{json .}}' "], $this);
|
$containers = instant_remote_process(["docker ps -a --format '{{json .}}' "], $this);
|
||||||
$containers = format_docker_command_output_to_json($containers);
|
$containers = format_docker_command_output_to_json($containers);
|
||||||
@@ -566,10 +565,6 @@ $schema://$host {
|
|||||||
} else {
|
} else {
|
||||||
return collect([]);
|
return collect([]);
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
|
||||||
return handleError($e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public function hasDefinedResources()
|
public function hasDefinedResources()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user