jpackage: support passing multiple exceptions to the top-level error handler

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Affects Version/s: 27
    • Component/s: tools
    • None
    • generic
    • generic

      If jpackage detects multiple errors on the command line, it will report them all, not just the first [1].

      However, there is no support for passing multiple exceptions after command-line option validation. If multiple error conditions occur later in the execution flow, the first one is reported with the thrown exception, and the remaining are reported in place [2] instead of being handed to the top-level error reporter.

      Use the standard suppressed exceptions mechanism to pass multiple exceptions to the top-level error reporter.

      [1] https://github.com/openjdk/jdk/blob/f9ded7f88cce75151cec32d1ef1f9662ea10431a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/cli/Main.java#L315

      [2] https://github.com/openjdk/jdk/blob/f9ded7f88cce75151cec32d1ef1f9662ea10431a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacFromOptions.java#L171

            Assignee:
            Alexey Semenyuk
            Reporter:
            Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: