snowdrop / release-manager

Jira Java Client Tool
3 stars 6 forks source link

Failure to add a watcher breaks the start-release command #96

Closed jacobdotcosta closed 3 years ago

jacobdotcosta commented 3 years ago

In the start-releaseexecution, if a watcher is not allowed to watch the issue an exception breaks the execution of the whole release.

RestClientException{statusCode=Optional.of(401), errorCollections=[ErrorCollection{status=401, errors={}, errorMessages=[The user "xxxxxxxxxx" does not have permission to view this issue. This user will not be added to the watch list.]}]}
    at com.atlassian.jira.rest.client.internal.async.DelegatingPromise.claim(DelegatingPromise.java:45)
    at dev.snowdrop.release.services.IssueService.lambda$addWatchers$2(IssueService.java:191)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at dev.snowdrop.release.services.IssueService.addWatchers(IssueService.java:189)
    at dev.snowdrop.release.services.IssueService.createIssue(IssueService.java:152)
    at dev.snowdrop.release.services.IssueService.createComponentRequests(IssueService.java:119)
    at dev.snowdrop.release.services.IssueService_ClientProxy.createComponentRequests(IssueService_ClientProxy.zig:256)
    at dev.snowdrop.release.App.startRelease(App.java:164)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1952)
    at picocli.CommandLine.access$1100(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
    at picocli.CommandLine.execute(CommandLine.java:2058)
    at dev.snowdrop.release.App.run(App.java:76)
    at dev.snowdrop.release.App_ClientProxy.run(App_ClientProxy.zig:260)
    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:113)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
    at dev.snowdrop.release.App.main(App.java:71)
Caused by: RestClientException{statusCode=Optional.of(401), errorCollections=[ErrorCollection{status=401, errors={}, errorMessages=[The user "xxxxxxxxxx" does not have permission to view this issue. This user will not be added to the watch list.]}]}
    at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:176)