Uploaded image for project: 'BlueJ'
  1. BlueJ
  2. BLUEJ-404

Bad error reporting in CodePad, maybe should evaluate to exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Done
    • Affects Version/s: 3.0.6
    • Fix Version/s: 3.0.9
    • Component/s: CodePad

      Description

      The attached image shows what goes wrong.

      In CodePad I enter:

      new TicketMachine(-3,2)

      but the TicketMachine constructor (shown) throws an exception when its ticketPrice argument is negative.

      Unfortunately, the error that the CodePad prints is uninformative, probably because the expression is syntactically correct and only fails at runtime.

      It might be better to catch the thrown exception and call that its value.

      The error message could be:

      Error: IllegalArgumentException thrown

      and a little IllegalArgumentException mini-icon, draggable to the Object Bench in the usual way, could show up to the left.

        Attachments

          Activity

            People

            • Assignee:
              davmac Davin McCall
              Reporter:
              external External via trac
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: