fix: route all console.error through ErrorHandler for consistent tracking
Converted 35+ raw console.error calls to use ErrorHandler.logError() across 12 files. ErrorHandler provides structured logging, local error storage, and error tracking integration. Files: - app-selector.js: 4 errors (fetch templates, port check, suggested port, deploy) - globals.js: 2 errors (CSRF token get/add) - service-credentials.js: 2 errors (save/clear credentials) - totp-settings.js: 4 errors (TOTP setup, session duration, disable, AuthCard) - notification-settings.js: 2 errors (load config, load history) - setup-wizard.js: 2 errors (save config to server) - progress-tracker.js: 4 errors (storage read/write/session/fallback) - tooltip-definitions.js: 2 errors (validation, condition eval) - tour-manager.js: 2 errors (Driver.js not loaded, tooltip not found) - theme-adapter.js: 1 error (theme change callback) - weather.js: 1 error (weather update) - onboarding.js: removed duplicate console.error, fixed 2 remaining calls All console.error calls in the DashCaddy frontend now go through ErrorHandler.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// ========== NOTIFICATION SETTINGS ==========
|
||||
(function() {
|
||||
const errorHandler = new ErrorHandler();
|
||||
// Inject modal HTML
|
||||
injectModal('notifications-modal', `<div id="notifications-modal" class="weather-modal">
|
||||
<div class="weather-modal-content" style="min-width: 550px; max-width: 650px;">
|
||||
@@ -255,7 +256,7 @@
|
||||
document.getElementById('event-deploy-failed').checked = config.events?.deploymentFailed !== false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load notification config:', error);
|
||||
errorHandler.logError('[Notifications] Load Config', error, { function: 'loadConfig' });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +290,7 @@
|
||||
container.innerHTML = '<div style="color: var(--muted); text-align: center; padding: 20px;">No notifications yet</div>';
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load notification history:', error);
|
||||
errorHandler.logError('[Notifications] Load History', error, { function: 'loadHistory' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user