Modul8 catches exceptions without letting us know
  • User avatar
    aalex
    junior Member
    Posts: 6
    Joined: Wed Jul 16, 2008 4:50 pm
    Location: Montréal, Québec, Canada
    Contact:

    Modul8 catches exceptions without letting us know

    by aalex » Mon Dec 22, 2008 8:25 pm

    Bonjour,

    I have been doing intensive development in Python with Modul8 recently, and I can say it is very difficult. Modul8's IDE didn't make my life easy at all. :evil:

    It seems like Modul8 sometimes catches exceptions (errors) without printing anything to the console or popping up an error window. After a lot of hours trying to find out why some parts of my code were not executed, I finally ended up with a solution like this:

    Code: Select all

    import sys
    try:
        pass # do whatever you need to do here (all your code)
    except:
        print "An error happened ! ", sys.exc_info()
        raise Exception,"Stopping the module, since a bug is found"+str(sys.exc_info())


    Is is not very elegant to catch any type of exceptions, but it might be very useful when your code does a lot of things.

    If we don't use the try statement like this, some parts of our code will never be executed, silently, if an exception happens.

    I think there should be something printed in the error console if an exception happens, instead of not letting the programmer know.

    Thank you,
  • User avatar
    sigmasix
    master
    Posts: 1224
    Joined: Thu Dec 02, 2004 2:12 pm
    Location: gva | switzerland
    Contact:

    by sigmasix » Wed Dec 24, 2008 10:53 am

    Hi,
    I never had an error in my code that wasn't told... Can you explain a bit what you tried to do and how we can reproduce this, maybe there's a real bug in the system but to correct it we must know what's happening... can you send your module to support at garagecube dot com ?
  • User avatar
    aalex
    junior Member
    Posts: 6
    Joined: Wed Jul 16, 2008 4:50 pm
    Location: Montréal, Québec, Canada
    Contact:

    by aalex » Wed Dec 24, 2008 6:44 pm

    Hi sigma6,
    You can download our module directly from the Subversion repository at https://svn.sat.qc.ca/rawmaterials/trun ... erials.m8m : you need to also download and install the RawMaterials.app application in order to use the module. The version of the module in the .dmg is outdated though, and you should use the version in the first URL I have pasted, not the one in the DMG. You can donwload that DMG and read more informations about RawMaterials on our web page : http://camaro.mobilemuse.ca/~sat/presentation/

    RawMaterials is a Mac OS X application that allows an artist to receive media assets (photos, video, SMS texts, etc) sent by cellphone users. We are developing a Modul8 module.

    We, At Society for Arts and Technology, didn't post anything yet to Modul8 users about this new piece of software yet, because it is still in beta testing.

    Thus, in order to test it, you need to install the RawMaterials.app in your Applications folder. Next, you need a Muse III username. You can use username "sat" for testing the downloads. You then need to enable channels in the left side of the RawMaterials.app.

    We implemented the OSC protocol using Twisted, an asynchronous network library. This avoids blocking calls. This might be why I encounter some exceptions that are hard to catch.

    Thanks !
    (cool eh?) :D
  • User avatar
    zoophar
    activ8 member
    Posts: 81
    Joined: Sat Oct 20, 2007 1:33 pm
    Location: geneva / Berlin
    Contact:

    by zoophar » Tue Dec 30, 2008 7:32 pm

    Hi alex

    i didn't downloaded yet you module but it looks great !!!! wonderfull !!!!

    I have sometimes the same problem....

    also, sometimes, the script error is telling things
    and is unable to highligth the line with the error
    (boring when my error is at line 535...)

    i can run modules with big errors,
    (variables not defined, or variables that were just put in functions without beeing globalised)

    it says errors that occured at a previous run.


    i'm sorry to say that, but
    it seems to happens when my code is dirty

    sorry

    tip: don't forget to stop your module via the menu bar modules/Stop
    because, if you just restart your module with cmd+alt+R, the __init__ of the module script is not loaded... and you can have thing running like described before...
  • User avatar
    david
    garageCube team
    Posts: 217
    Joined: Tue Jan 08, 2008 1:14 am
    Location: Antibes, France

    by david » Mon Jan 05, 2009 2:56 pm

    Hello aalex and zoophar,

    I have tried to reproduce this issue with no success. I made a module with a :
    raise Exception("Init!")

    in Init/MessageEvent/KeywordEvent/DirectEvent/PeriodicalEvent, the exception is trapped correctly and shown in "script errors" dialog.

    Do you have a shorter example (than RawMaterials) that will allow us to reproduce the problem ?

    When you say "exception", you mean Python's Exception or also compilation errors ? syntax errors ? logical errors in your script (using undefined variables, ...) ?

    Thanks.

    David
  • User avatar
    zoophar
    activ8 member
    Posts: 81
    Joined: Sat Oct 20, 2007 1:33 pm
    Location: geneva / Berlin
    Contact:

    by zoophar » Mon Jan 05, 2009 8:38 pm

    Hello David,

    for me it's OK,

    i just have to clean my code...
    or restart the module the good way
    or, if it's still not showing the line with error, i just restart M8...

    it's like M8 doesn't undestand anything anymore when i say to much crapp
    (like humans huhu!)

    thank you ;-)

Who is online

Users browsing this forum: No registered users and 32 guests