Skip to content

Commit e65c4fd

Browse files
authored
Fix error handling for index-sitemap (#9)
1 parent e49b26a commit e65c4fd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/metal-geese-sniff.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@team-plain/cli": patch
3+
---
4+
5+
Fix error handling for index-sitemap

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ program
7777
}
7878

7979
for (const url of urls) {
80-
await indexUrl(url, labelTypeIds);
80+
const res = await indexUrl(url, labelTypeIds);
81+
if (res.isErr) {
82+
handleError(res.error.message, res.error.requestId);
83+
}
8184
}
8285

8386
console.log(`Successfully indexed ${urls.length} urls`);

0 commit comments

Comments
 (0)