Skip to content

Commit

Permalink
Merge pull request #51 from peter-evans/not-found-error
Browse files Browse the repository at this point in the history
Improve error message for 404 errors
  • Loading branch information
peter-evans authored Nov 11, 2020
2 parents 938c222 + eed51ed commit ce5485d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ function run() {
}
catch (error) {
core.debug(util_1.inspect(error));
core.setFailed(error.message);
if (error.status == 404) {
core.setFailed('Repository not found, OR token has insufficient permissions.');
}
else {
core.setFailed(error.message);
}
}
});
}
Expand Down
8 changes: 7 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ async function run(): Promise<void> {
})
} catch (error) {
core.debug(inspect(error))
core.setFailed(error.message)
if (error.status == 404) {
core.setFailed(
'Repository not found, OR token has insufficient permissions.'
)
} else {
core.setFailed(error.message)
}
}
}

Expand Down

0 comments on commit ce5485d

Please sign in to comment.