[BLUEJ-404] Bad error reporting in CodePad, maybe should evaluate to exception
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.
Issue metadata
- Issue type: Bug
- Priority: Low
- Fix versions: 3.0.9