Add error handling to weather widget

- Wrap getCurrentWeather() in try-catch block
- Prevents white screen if weather API fails
- Shows error message in widget instead
- Add test-weather.php for debugging
This commit is contained in:
Claude
2026-01-22 21:06:50 +00:00
parent 20704b3cd8
commit 7e468d51ca
2 changed files with 36 additions and 1 deletions
+5 -1
View File
@@ -2644,7 +2644,11 @@ body.theme-neo footer {
<!-- WEATHER WIDGET -->
<?php if ($settingsManager->isWeatherEnabled()): ?>
<?php
$weather = $weatherManager->getCurrentWeather();
try {
$weather = $weatherManager->getCurrentWeather();
} catch (Exception $e) {
$weather = ['error' => 'Fehler: ' . $e->getMessage()];
}
if ($weather && !isset($weather['error'])):
?>
<div id="weather-widget" class="weather-widget">