Skip to content

Commit

Permalink
refactor: define func name and enhance error handling in write.js (#264)
Browse files Browse the repository at this point in the history
Co-authored-by: tiendn <[email protected]>
  • Loading branch information
tiendn and 0xTylerD26 authored Jun 14, 2024
1 parent 94073df commit d181038
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/write.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
const buildList = require("./buildList");

buildList().then((data) => console.log(JSON.stringify(data, null, 2)));
async function fetchDataAndLog() {
try {
const data = await buildList();
console.log(JSON.stringify(data, null, 2));
} catch (error) {
console.error("Failed to build list:", error);
}
}

fetchDataAndLog();

0 comments on commit d181038

Please sign in to comment.