Skip to content

Commit

Permalink
Merge pull request #72 from shipkit/sf
Browse files Browse the repository at this point in the history
Improved error message
  • Loading branch information
shestee authored Jan 3, 2021
2 parents a551005 + e651bfd commit b077d14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ class GithubReleasePluginIntegTest extends BaseSpecification {

then: //fails because we don't have the credentials
result.output.contains """Unable to post release to Github.
- url: https://api.github.com/repos/shipkit/shipkit-changelog/releases
- release tag: v1.2.3
- release name: v1.2.3
- token: sec...
- content:
Spanking new release!"""
* url: https://api.github.com/repos/shipkit/shipkit-changelog/releases
* release tag: v1.2.3
* release name: v1.2.3
* token: sec...
* content:
Spanking new release!
* underlying problem:"""
}
}
13 changes: 8 additions & 5 deletions src/main/java/org/shipkit/gh/release/GithubReleaseTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,14 @@ public void setNewTagRevision(String newTagRevision) {
LOG.lifecycle("Posted release to Github: " + htmlUrl);
} catch (IOException e) {
throw new GradleException("Unable to post release to Github.\n" +
" - url: " + url + "\n" +
" - release tag: " + releaseTag + "\n" +
" - release name: " + releaseName + "\n" +
" - token: " + githubToken.substring(0, 3) + "...\n" +
" - content:\n" + releaseNotesTxt + "\n"
" * url: " + url + "\n" +
" * release tag: " + releaseTag + "\n" +
" * release name: " + releaseName + "\n" +
" * token: " + githubToken.substring(0, 3) + "...\n" +
" * content:\n" + releaseNotesTxt + "\n\n" +
" * underlying problem: " + e.getMessage() + "\n" +
" * troubleshooting: please run Gradle with '-s' to see the full stack trace or inspect the build scan\n" +
" * thank you for using Shipkit!"
, e);
}
}
Expand Down

0 comments on commit b077d14

Please sign in to comment.