Skip to content

Commit

Permalink
fix(author-scraper): 🐛 throw error on catching name error instead of …
Browse files Browse the repository at this point in the history
…just logging it
  • Loading branch information
djdembeck committed Oct 3, 2021
1 parent 166c30d commit ef6976e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/helpers/authors/audibleScrape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,8 @@ class ScrapeHelper {
try {
// Workaround data error: https://github.com/cheeriojs/cheerio/issues/1854
returnJson.name = ($('h1.bc-text-bold')[0].children[0] as any).data
if (!returnJson.name) {
throw new Error('Author name not available')
}
} catch (err) {
console.error(err)
throw new Error('Author name not available')
}

return returnJson
Expand Down

0 comments on commit ef6976e

Please sign in to comment.