diff --git a/src/utils/RegHubUtil.js b/src/utils/RegHubUtil.js index 25e9b3e603..8bad189107 100644 --- a/src/utils/RegHubUtil.js +++ b/src/utils/RegHubUtil.js @@ -80,7 +80,11 @@ module.exports = { data.is_recommended = true; _.extend(data, repo); cb(null, data); + } else { + repositoryServerActions.error({error: new Error('Could not fetch repository information from Docker Hub.')}); + return; } + }); }, (error, repos) => { repositoryServerActions.recommendedUpdated({repos}); @@ -135,6 +139,11 @@ module.exports = { return; } + if (response.statusCode !== 200) { + repositoryServerActions.error({error: new Error('Could not fetch repository information from Docker Hub.')}); + return; + } + let data = JSON.parse(body); cb(null, data.results); });