Branch: refs/heads/master Home: https://github.com/jenkinsci/stash-pullrequest-builder-plugin Commit: bfc9bb4d66b95dd198446264b8fddb557e259ace https://github.com/jenkinsci/stash-pullrequest-builder-plugin/commit/bfc9bb4d66b95dd198446264b8fddb557e259ace Author: Pavel Roskin <plros...@gmail.com> Date: 2019-07-11 (Thu, 11 Jul 2019)
Changed paths: M src/test/java/stashpullrequestbuilder/stashpullrequestbuilder/stash/StashApiClientTest.java A src/test/resources/__files/PostPullRequestComment.json A src/test/resources/__files/PullRequestCommentsEmpty.json A src/test/resources/__files/PullRequestCommentsPage1.json A src/test/resources/__files/PullRequestCommentsPage2.json A src/test/resources/__files/PullRequestCommentsPage3.json A src/test/resources/__files/PullRequestListEmpty.json A src/test/resources/__files/PullRequestListPage1.json A src/test/resources/__files/PullRequestListPage2.json A src/test/resources/__files/PullRequestListPage3.json A src/test/resources/__files/PullRequestMergeStatus.json Log Message: ----------- StashApiClientTest: Add WireMock based tests for StashApiClient Document discovered issues. Commit: c218eeff82c1339e6224c832087211ff5eaff89b https://github.com/jenkinsci/stash-pullrequest-builder-plugin/commit/c218eeff82c1339e6224c832087211ff5eaff89b Author: Pavel Roskin <plros...@gmail.com> Date: 2019-07-11 (Thu, 11 Jul 2019) Changed paths: M src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashBuildListener.java M src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashRepository.java M src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/stash/StashApiClient.java M src/test/java/stashpullrequestbuilder/stashpullrequestbuilder/StashBuildListenerTest.java M src/test/java/stashpullrequestbuilder/stashpullrequestbuilder/StashRepositoryTest.java M src/test/java/stashpullrequestbuilder/stashpullrequestbuilder/stash/StashApiClientTest.java Log Message: ----------- Clean up exception handling in StashApiClient Stop using RuntimeException, it's an unchecked exception. The callers may be unaware that they need to handle it. Stop using Exception. Always use most specific exception types. Always rethrow caught exceptions by wrapping them in StashApiClient. Let the callers handle them, as they are in a better position to chose what to do and emit meaningful logs. Don't print stack trace in StashApiClient. Print it when the exception is handled. Some callers log the stack trace to the build log, not to the global Jenkins log. Don't log error messages and throw StashApiException at the same time, unless the log message contains information that is not added to the exception. Adjust "throws" declarations. Catch errors where appropriate and log them. Document functions that throw StashApiException. Add comments explaining how StashApiException is handled. Adjust unit tests for the new behavior. Compare: https://github.com/jenkinsci/stash-pullrequest-builder-plugin/compare/d28f5adb62de...c218eeff82c1 -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/stash-pullrequest-builder-plugin/push/refs/heads/master/d28f5a-c218ee%40github.com. For more options, visit https://groups.google.com/d/optout.