Skip to content

Commit 70f730c

Browse files
committed
console errors hashnode
1 parent 602321d commit 70f730c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

apps/codingcatdev/scripts/podcast-hashnode.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ ${content}`;
112112
// Get new devto url and update
113113
if (response.status === 200) {
114114
const json = await response.json();
115+
if (json?.errors?.length) {
116+
console.error(JSON.stringify(json.errors));
117+
continue;
118+
}
115119
console.log('hashnode url', json?.data?.createPublicationStory?.post?.slug);
116120
const hashnodeSlug = json?.data?.createPublicationStory?.post?.slug;
117121

apps/codingcatdev/scripts/post-hashnode.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ for await (const file of g) {
5656
// TODO: We might need to add a check on cononical if this page is already in dev.to
5757
if (
5858
fm?.slug &&
59+
fm.slug === 'angular-17-cypress-testing' &&
5960
fm?.title &&
6061
fm?.cover &&
6162
fm?.published === 'published' &&
@@ -107,6 +108,11 @@ ${content}`;
107108
// Get new devto url and update
108109
if (response.status === 200) {
109110
const json = await response.json();
111+
if (json?.errors?.length) {
112+
console.error(JSON.stringify(json.errors));
113+
continue;
114+
}
115+
110116
console.log('hashnode url', json?.data?.createPublicationStory?.post?.slug);
111117
const hashnodeSlug = json?.data?.createPublicationStory?.post?.slug;
112118

0 commit comments

Comments
 (0)