Skip to content

Commit 97b45cd

Browse files
author
Nathan Friend
authored
fix: handle errors that don't have a response (#214)
1 parent e52f739 commit 97b45cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/verify.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ module.exports = async (pluginConfig, context) => {
5959
errors.push(getError('EGLNOPERMISSION', {repoId}));
6060
}
6161
} catch (error) {
62-
if (error.response.statusCode === 401) {
62+
if (error.response && error.response.statusCode === 401) {
6363
errors.push(getError('EINVALIDGLTOKEN', {repoId}));
64-
} else if (error.response.statusCode === 404) {
64+
} else if (error.response && error.response.statusCode === 404) {
6565
errors.push(getError('EMISSINGREPO', {repoId}));
6666
} else {
6767
throw error;

0 commit comments

Comments
 (0)