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

@@ -13,8 +13,14 @@ class Server extends Component
{
parent::mount($server);
// Check and enforce bandwidth throttling if exceeded
$this->checkAndEnforceBandwidthLimit();
// Check and enforce bandwidth throttling if exceeded (wrapped in try-catch to prevent lazy load failures)
try {
$this->checkAndEnforceBandwidthLimit();
} catch (\Throwable $e) {
\Log::warning('Failed to check bandwidth limit for server ' . $server->id, [
'error' => $e->getMessage(),
]);
}
}
public function getMonthlyTrafficProperty()