#8 Better error handling

closed-fixed
Backend (20)
5
2008-02-28
2007-08-26
Lars Friedrichs
No

As there is none at the moment it would be nice to be informed of what's going on and what is not working out. That should at least include
having a broken .blueproximityrc file,
using an unwritable logfile,
action commands not working out or taking too long to execute,
a mac address with the wrong format.

Discussion

  • Thorsten
    Thorsten
    2007-09-22

    Logged In: YES
    user_id=1692926
    Originator: NO

    Here's my patch:

    --- ../blueproximity-1.2/proximity.py 2007-09-11 23:48:34.000000000 +0200
    +++ proximity.py 2007-09-22 10:41:15.000000000 +0200
    @@ -28,7 +28,14 @@ import gobject
    import signal
    from configobj import ConfigObj
    from validate import Validator
    -import bluetooth
    +try:
    + import bluetooth
    +except:
    + print "The program cannot import the module bluetooth."
    + print "Please make sure the bluetooth bindings for python are installed."
    + print "E.g. with Ubuntu Linux, type:"
    + print "sudo apt-get install python-bluez"
    + sys.exit(1)
    import _bluetooth as bluez
    import syslog
    import locale
    @@ -730,4 +737,4 @@ if __name__=='__main__':
    # make GTK threadable
    gtk.gdk.threads_init()
    gtk.main()
    -
    \ No newline at end of file
    +

     
    • labels: --> Backend
    • assigned_to: nobody --> highno
     
  • Logged In: YES
    user_id=114903
    Originator: YES

    Thanks for the patch - I now included it and expanded that solution to all external modules. Watch out for the SVN version and new nightly build tonight.

    Bye
    Lars

     
  • Logged In: YES
    user_id=114903
    Originator: YES

    a broken config file is now mentioned on the console.
    I think that these outputs should all go on console if the relate to changes that could only be made on the console itself like changing the config file to an unallowed structure.

     
    • status: open --> open-later
     
  • Logged In: YES
    user_id=114903
    Originator: YES

    Unwritable logfiles are also noted on the console.

     
  • Logged In: YES
    user_id=114903
    Originator: YES

    Action commands will now be logged if a command takes too long to execute. This should be about it...

     
    • status: open-later --> closed-fixed