Added a better exception when a token is missing

This commit is contained in:
Marcin Grzejszczak
2018-10-29 10:53:46 +01:00
parent dacba0314e
commit d2403f57b5
2 changed files with 5 additions and 2 deletions

View File

@@ -45,7 +45,10 @@ class GithubMilestones {
void closeMilestone(ProjectVersion version) {
Assert.hasText(this.properties.getGit().getOauthToken(),
"You have to pass Github OAuth token for milestone closing to be operational");
"You must set the value of the OAuth token. You can do it "
+ "either via the command line [--releaser.git.oauth-token=...] "
+ "or put it as an env variable in [~/.bashrc] or "
+ "[~/.zshrc] e.g. [export RELEASER_GIT_OAUTH_TOKEN=...]");
String tagVersion = version.version;
Milestone.Smart foundMilestone = matchingMilestone(tagVersion, openMilestones(version));
if (foundMilestone != null) {

View File

@@ -229,7 +229,7 @@ public class GithubMilestonesTests {
thenThrownBy(() -> milestones.closeMilestone(nonGaSleuthProject()))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("You have to pass Github OAuth token for milestone closing to be operational");
.hasMessageContaining("You must set the value of the OAuth token");
}
ReleaserProperties withToken() {