Processing not reporting line # of error in Handlers

Issue #124 wontfix
Keith O'Hara created an issue

Processing handlers aren't reporting what line the exception was thrown:

Done Error in onLoop: expected float, got builtin_function_or_method loop is now stopping.

from Processing import *

window(500, 500)

def draw():
    background(0)
    ellipse(mouseX, mouseY, 50, 50)

onLoop += draw
loop()

Comments (7)

  1. Doug Blank

    I'm not sure that we can get stack trace, but we can give a better error message if we allow "object" to be passed in, and then check the types. Then we could give the error:

    Error in calling ellipse: expected float, got builtin_function_or_method

    That would be a lot of work to do that for all methods and would result in some overhead.

    Maybe we can examine the exception better though, and give a better trace. It would have to work for all languages though.

  2. Keith O'Hara reporter

    Could we throw a particular exception the DLR runtime could then handle and report the line #?

  3. Doug Blank

    I don't think we can get a stack trace. I think we could, however, get the error message above by changing either IronPython or the DLR code. It should report the name of the function that it is trying to run.

  4. Log in to comment