Skip to content

Commit f754ca9

Browse files
committed
fix: improve application initialization error handling
- Update error messages during application initialization to provide user-friendly guidance regarding network issues related to Hugging Face resources.
1 parent 6a15057 commit f754ca9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

docs/js/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ class Application {
9494
console.log('✓ Application initialized successfully');
9595

9696
} catch (err) {
97-
ErrorNotifier.error('Failed to initialize application: ' + err.message, err);
97+
const userFriendlyMsg = 'Since the web resources are hosted on Hugging Face, your network connection may affect the loading of these resources. Please ensure you have a stable connection and refresh the page to try again.\n\n' +
98+
'Application initialization failed: ' + err.message;
99+
ErrorNotifier.error(userFriendlyMsg, err);
98100

99101
setTimeout(() => {
100102
document.getElementById('loadingOverlay').classList.add('hidden');

docs/js/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ function initApp() {
1313
try {
1414
APP.init();
1515
} catch (error) {
16-
ErrorNotifier.error('Application initialization failed. Please refresh the page.', error);
16+
const userFriendlyMsg = 'Since the web resources are hosted on Hugging Face, your network connection may affect the loading of these resources. Please ensure you have a stable connection and refresh the page to try again.\n\n' +
17+
'Application initialization failed. Please refresh the page.';
18+
ErrorNotifier.error(userFriendlyMsg, error);
1719
}
1820
}
1921

0 commit comments

Comments
 (0)