1
0
Fork 0

report unknown error in the case of missing error message

This commit is contained in:
Ryan Mwangi 2024-10-21 15:29:48 +03:00
parent cf52d8e6e4
commit fe446b1b09
1 changed files with 4 additions and 4 deletions

View File

@ -23,9 +23,9 @@ const form = document.getElementById('merge-form');
const linkGroupName = document.getElementById('link-group-name').value; const linkGroupName = document.getElementById('link-group-name').value;
const calendarsData = []; const calendarsData = [];
for (let i = 0; i < calendarIndex; i++) { for (let i = 0; i < calendarIndex; i++) {
const prefix = document.getElementById(`prefix-${i}`).value; const prefix = document.getElementById(`prefix-${i}`);
const override = document.getElementById(`override-${i}`).checked; const override = document.getElementById(`override-${i}`);
const url = document.getElementById(`url-${i}`).value; const url = document.getElementById(`url-${i}`);
if (prefix && override && url) { if (prefix && override && url) {
calendarsData.push({ calendarsData.push({
prefix: prefix.value, prefix: prefix.value,
@ -53,6 +53,6 @@ const form = document.getElementById('merge-form');
}) })
.catch((error) => { .catch((error) => {
console.error('Error:', error); console.error('Error:', error);
result.innerHTML = `Error merging calendars: ${error.message}` result.innerHTML = `Error merging calendars: ${error.message || 'Unknown error'}`
}); });
}); });