Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-8864

Report authentication errors immediately without looking at the response's body

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • Committer CLI 1.0.0
    • Tooling
    • None

    Description

      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.

      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)
      

      Attachments

        Issue Links

          Activity

            People

              radu Radu Cotescu
              radu Radu Cotescu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m