Skip to content

Commit

Permalink
feat: Removed silent Error
Browse files Browse the repository at this point in the history
Signed-off-by: Jaid <jaid.jsx@gmail.com>
  • Loading branch information
Jaid committed Dec 14, 2019
1 parent a0bc583 commit aab4585
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NoResultsError extends Error {
}

const fetchUploadsForPath = async (channelPath, options = {}) => {
const retries = options.retries || 1
const retries = options.retries || 3
const fetchJob = async () => {
const {statusCode, url, body, statusMessage} = await gotClient(channelPath)
if (statusCode !== 200) {
Expand All @@ -50,11 +50,7 @@ const fetchUploadsForPath = async (channelPath, options = {}) => {
return result
}

try {
return pRetry(repeatedFetchJob, {retries})
} catch {
return []
}
return pRetry(repeatedFetchJob, {retries})
}

/**
Expand All @@ -65,7 +61,7 @@ const fetchUploadsForPath = async (channelPath, options = {}) => {

/**
* @typedef {Object} Options
* @prop {number} retries
* @prop {number} [retries = 3]
*/

const fetchUploadsForChannelId = (channelId, options) => fetchUploadsForPath(`channel/${channelId}/videos`, options)
Expand Down

0 comments on commit aab4585

Please sign in to comment.