Changeset 370:0f88a48293bd in SMSSender


Ignore:
Timestamp:
Apr 14, 2014 11:35:44 AM (4 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
separation-frontend-backend
Message:
  • We now distinguish between errors that occur while loading a library (invalid format, wrong version, ...) and errors that are thrown while initializing it.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • common/exceptions/elibraryloadexception.cpp

    r316 r370  
    6161        case Other:
    6262            return msg + EException::toString();
     63        case Initialization:
     64            return msg + QObject::tr("Internal error while initializing the library");
    6365        case Unknown:
    6466        default:
  • common/exceptions/elibraryloadexception.h

    r319 r370  
    3232        VersionMismatch,
    3333        Other,
     34        Initialization,
    3435        Unknown
    3536    };
  • frontend/business/libraryloader_base.cpp

    r364 r370  
    5050#endif
    5151            loadLibrary(libraryPath.absoluteFilePath(filename));
    52         } catch (EException& e) {
    53             qWarning() << "Erroneous library [" << libraryPath <<"]:" << e.chainedWhat();
     52        } catch (Library::ELoadException &e) {
     53            qWarning() << e.chainedWhat();
    5454        }
    5555    }
     
    9292                    QScopedPointer<IIntegrationHelper::Factory> integrationHelperFactory(
    9393                                createIntegrationHelperFactory(lib->identificationKey()));
    94                     lib->init(*integrationHelperFactory);
     94                    try {
     95                        lib->init(*integrationHelperFactory);
     96                    } catch (EException &e){
     97                        Library::ELoadException(Library::ELoadException::Initialization)
     98                                .chain(e)
     99                                .raise();
     100                    } catch (...){
     101                        Library::ELoadException(Library::ELoadException::Initialization)
     102                                .raise();
     103                    }
    95104                }
    96105
     
    115124        }
    116125    } catch (Library::ELoadException& e) {
    117         qWarning() << "Error while loading library: " << e.toString();
    118126        e.addDebugInfo("filename", filename)
    119                 .raise();
    120     } catch (EException& e) {
    121         Library::ELoadException(Library::ELoadException::Unknown)
    122                 .addDebugInfo("filename", filename)
    123                 .chain(e)
    124127                .raise();
    125128    } catch (...) {
Note: See TracChangeset for help on using the changeset viewer.