Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8262731

[macOS] Exception from "Printable.print" is swallowed during "PrinterJob.print"

    XMLWordPrintable

Details

    • 2d
    • b02
    • os_x

    Backports

      Description

        ADDITIONAL OS VERSION INFORMATION :
        macOS 10.15.7

        A DESCRIPTION OF THE PROBLEM :
        If the method "java.awt.print.Printable.print​(Graphics, PageFormat, int)" throws "java.lang.RuntimeException" or "java.awt.print.PrinterException" during the call "java.awt.print.PrinterJob.print()", then the exception is swallowed by JDK and a user cannot learn that printing failed and what caused failure of printing, because "PrinterJob.print()" method does not throw "PrinterException" or the occurred exception is not reported by JDK through the error stream.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Compile and run the attached to this bug test case "ExceptionFromPrintableIsIgnored.java".
        2. In the shown window of the test case select a type of an exception that should be thrown from "java.awt.print.Printable.print" method and select on which thread the method "java.awt.print.PrinterJob.print" should be executed.
        3. Click "Run Test" button, in the shown dialog select printer and initiate printing.

        The bug is reproduced, if no exception is displayed in the text area "Test Results:" and no exception is reported in the console at the same time.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED - A printed out stack trace or a thrown exception to indicate to the developer where the problem lies or at least why printing cannot complete normally.
        ACTUAL - The exception is swallowed.

        Attachments

          Issue Links

            Activity

              People

                alitvinov Anton Litvinov (Inactive)
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: