Add error handling to debug button

Added:
- Console log when button is clicked
- Console log showing button element
- Try-catch wrapper around the function
- Error logging with stack trace

This will show if the button click is detected and where it fails!
This commit is contained in:
renato97
2025-11-04 05:41:25 +00:00
parent 8f15cb8001
commit cba176dab9

View File

@@ -111,7 +111,13 @@
if (btnDebugPages) { if (btnDebugPages) {
btnDebugPages.addEventListener('click', (e) => { btnDebugPages.addEventListener('click', (e) => {
console.log('🎯 BUTTON CLICKED: Debug Contar Páginas'); console.log('🎯 BUTTON CLICKED: Debug Contar Páginas');
console.log('📝 Button element:', btnDebugPages);
try {
debugCountPagesForAllManga(); debugCountPagesForAllManga();
} catch (error) {
console.error('❌❌❌ Error in debugCountPagesForAllManga:', error);
console.error('Stack:', error.stack);
}
}); });
} else { } else {
console.error('❌ btnDebugPages not found!'); console.error('❌ btnDebugPages not found!');