[
https://issues.apache.org/jira/browse/SLING-8864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16992728#comment-16992728
]
Radu Cotescu edited comment on SLING-8864 at 12/11/19 1:25 PM:
---------------------------------------------------------------
There's no test case we need to add. I think we should skip parsing the
response body in case we encounter a 401 and just report it as such.
was (Author: radu.cotescu):
There's no test case we need to add. I think we should just skip parsing the
response body in case we encounter a 401 and just report it as such.
> Report authentication errors immediately without looking at the response's
> body
> -------------------------------------------------------------------------------
>
> Key: SLING-8864
> URL: https://issues.apache.org/jira/browse/SLING-8864
> Project: Sling
> Issue Type: Bug
> Components: Tooling
> Reporter: Radu Cotescu
> Assignee: Radu Cotescu
> Priority: Major
> Fix For: Committer CLI 1.0.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When the JIRA password is not passed correctly, the 401 errors should be
> reported in a more easy to understand format, since there's no need to parse
> the response body.
> {noformat}
> docker run -it --env-file=./docker-env apache/sling-cli release
> create-new-jira-version -r 2160 -x INTERACTIVE
> Found Version: Resource Resolver 1.6.16 (id=12346273, fixed issues=3).
> Should version Resource Resolver 1.6.18 be created?
> Yes (y)/No (n)? [Yes (y)]:
> Failed executing command
> java.io.IOException: Status line : HTTP/1.1 401 401. Failed parsing response
> as JSON ( java.lang.IllegalStateException: Expected BEGIN_OBJECT but was
> STRING at line 11 column 1 path $ )
> at
> org.apache.sling.cli.impl.jira.VersionClient.newException(VersionClient.java:235)
> at
> org.apache.sling.cli.impl.jira.VersionClient.create(VersionClient.java:156)
> at
> org.apache.sling.cli.impl.release.CreateJiraVersionCommand.run(CreateJiraVersionCommand.java:90)
> at picocli.CommandLine.executeUserObject(CommandLine.java:1687)
> at picocli.CommandLine.access$900(CommandLine.java:146)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2059)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2026)
> at
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1893)
> at picocli.CommandLine.execute(CommandLine.java:1822)
> at
> org.apache.sling.cli.impl.CommandProcessor.runCommand(CommandProcessor.java:110)
> at
> org.apache.sling.cli.impl.ExecutionTrigger.lambda$activate$0(ExecutionTrigger.java:33)
> at java.base/java.lang.Thread.run(Unknown Source)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)