Skip to content

Commit 42f39ae

Browse files
authored
Merge pull request #83 from Ankit7Das/check2
Optmized logging to ease of troubleshooting leaderboard parsing
2 parents c5938a5 + 49689cf commit 42f39ae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

leaderboard.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ <h3 style="text-align: center;">NWoC 2020 Leaderboard</h3>
104104
function maketable(data) {
105105
var rows = data.split(/\r?\n|\r/);
106106
if (rows.length <= 1) {
107-
$('#leader-div').html('<p>Data could not be parsed.</p>');
107+
$('#leader-div').html('<p>Problem observed while creating table.</p>');
108108
return;
109109
}
110110
var table = '<table class=\'leaderboard\'><thead><th>Position</th><th class=\'handle\'>GitHub Handle</th><th>Score</th></thead><tbody>';
@@ -113,8 +113,13 @@ <h3 style="text-align: center;">NWoC 2020 Leaderboard</h3>
113113
var cells = rows[i].split(',');
114114
if (cells.length != 2) {
115115
$('#leader-div').html('<p>Data could not be parsed.</p>');
116-
return;
116+
console.log("Offending row: ", rows[i]);
117+
console.log("Offending row index in sheets: ", i + 1);
118+
console.log("Offending cell length segment: ", cells.length);
119+
console.log("data for offending segment: ", cells[1]);
120+
117121
}
122+
console.log("cells length:", cells.length);
118123
console.log("data",cells[1]);
119124
sortedData.push({score: parseInt(cells[1].trim()), username: cells[0]});
120125
}

0 commit comments

Comments
 (0)