Skip to content

Commit

Permalink
fix: handle errors that don't have a response (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Friend authored Jan 27, 2021
1 parent e52f739 commit 97b45cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ module.exports = async (pluginConfig, context) => {
errors.push(getError('EGLNOPERMISSION', {repoId}));
}
} catch (error) {
if (error.response.statusCode === 401) {
if (error.response && error.response.statusCode === 401) {
errors.push(getError('EINVALIDGLTOKEN', {repoId}));
} else if (error.response.statusCode === 404) {
} else if (error.response && error.response.statusCode === 404) {
errors.push(getError('EMISSINGREPO', {repoId}));
} else {
throw error;
Expand Down

0 comments on commit 97b45cd

Please sign in to comment.