Github 'Not Found' for unplublished entries means there are no unpublished entries

This commit is contained in:
Cássio Zen 2016-12-01 19:59:29 -02:00
parent e34ce15485
commit 14c798517c
2 changed files with 7 additions and 1 deletions

View File

@ -67,7 +67,7 @@ function unpublishedEntriesFailed(error) {
return {
type: UNPUBLISHED_ENTRIES_FAILURE,
error: 'Failed to load entries',
payload: error.toString(),
payload: error,
};
}

View File

@ -100,6 +100,12 @@ export default class GitHub {
}));
});
return Promise.all(promises);
})
.catch((error) => {
if (error.message === 'Not Found') {
return Promise.resolve([]);
}
return error;
});
}