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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user