Add error handling to prevent lazy loading from getting stuck

- Wrap bandwidth throttling check in try-catch in Server.php
- Wrap loadVmStatus in try-catch in Component.php mount()
- Add fallback UI in server.blade.php when status is unavailable
- Show 'Unavailable' state instead of infinite skeleton loading
This commit is contained in:
2025-12-16 07:56:49 -05:00
parent 24eee90728
commit 0125349eb1
3 changed files with 37 additions and 3 deletions

View File

@@ -34,7 +34,14 @@ class Component extends BaseComponent
abort(403);
}
$this->loadVmStatus();
try {
$this->loadVmStatus();
} catch (\Throwable $e) {
\Log::error('Failed to load VM status for server ' . $server->id, [
'error' => $e->getMessage(),
]);
$this->status = null;
}
}
/**