Ignore:
Timestamp:
01/20/10 17:02:09 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
53fa43c
Parents:
a5c1179
Message:

implemented some error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/alarmdialog.cpp

    ra5c1179 r95596f6  
    4141    database.open();
    4242
    43     Event event = Event::getById(mEventId,confId);
    44     message->setText(QString(argv[1]).append("-").append(QString(argv[2])));
    45     message->setText(event.title());
    46     setWindowTitle(event.title());
     43    try
     44    {
     45        Event event = Event::getById(mEventId,confId);
     46        message->setText(event.title());
     47        setWindowTitle(event.title());
     48    }
     49    catch(OrmNoObjectException*)
     50    {
     51        message->setText(QString("No such event in the DB: %1").arg(QString::number(mEventId)));
     52        setWindowTitle("ERROR");
     53    }
     54    catch(...) {} // TODO: implement
    4755}
    4856
     
    6775{
    6876    // before closing the dialog, it is necessary to remove alarm flag from the DB
    69     Event event = Event::getById(mEventId,confId);
    70     event.setHasAlarm(false);
    71     event.update("alarm");
     77    try
     78    {
     79        Event event = Event::getById(mEventId,confId);
     80        event.setHasAlarm(false);
     81        event.update("alarm");
     82    }
     83    catch(OrmNoObjectException*) {} // TODO: implement
     84    catch(...) {} // just close dialog
    7285    qApp->quit();
    7386}
Note: See TracChangeset for help on using the changeset viewer.