Skip to content

Commit

Permalink
Merge pull request #3 from ModOrganizer2/constructor-catch
Browse files Browse the repository at this point in the history
Catch and rethrow .NET exceptions in OMODFrameworkWrapper constructor
  • Loading branch information
Holt59 authored May 20, 2021
2 parents 2a48b32 + 391bea1 commit 9eaddc2
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/OMODFrameworkWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,28 @@ OMODFrameworkWrapper::OMODFrameworkWrapper(MOBase::IOrganizer* organizer, QWidge
, mParentWidget(parentWidget)
, mWaitDialog(make_nullptr<QProgressDialog>())
{
AssemblyResolver::initialise(mMoInfo);
try
{
AssemblyResolver::initialise(mMoInfo);

constructorHelper();
constructorHelper();

connect(this, &OMODFrameworkWrapper::pickModName, this, &OMODFrameworkWrapper::pickModNameSlot, Qt::ConnectionType::BlockingQueuedConnection);
connect(this, &OMODFrameworkWrapper::createMod, this, &OMODFrameworkWrapper::createModSlot, Qt::ConnectionType::BlockingQueuedConnection);
connect(this, &OMODFrameworkWrapper::displayReadme, this, &OMODFrameworkWrapper::displayReadmeSlot, Qt::ConnectionType::BlockingQueuedConnection);
connect(this, &OMODFrameworkWrapper::showWaitDialog, this, &OMODFrameworkWrapper::showWaitDialogSlot, Qt::ConnectionType::QueuedConnection);
connect(this, &OMODFrameworkWrapper::hideWaitDialog, this, &OMODFrameworkWrapper::hideWaitDialogSlot, Qt::ConnectionType::QueuedConnection);
connect(this, &OMODFrameworkWrapper::pickModName, this, &OMODFrameworkWrapper::pickModNameSlot, Qt::ConnectionType::BlockingQueuedConnection);
connect(this, &OMODFrameworkWrapper::createMod, this, &OMODFrameworkWrapper::createModSlot, Qt::ConnectionType::BlockingQueuedConnection);
connect(this, &OMODFrameworkWrapper::displayReadme, this, &OMODFrameworkWrapper::displayReadmeSlot, Qt::ConnectionType::BlockingQueuedConnection);
connect(this, &OMODFrameworkWrapper::showWaitDialog, this, &OMODFrameworkWrapper::showWaitDialogSlot, Qt::ConnectionType::QueuedConnection);
connect(this, &OMODFrameworkWrapper::hideWaitDialog, this, &OMODFrameworkWrapper::hideWaitDialogSlot, Qt::ConnectionType::QueuedConnection);

initFrameworkSettings();
initFrameworkSettings();
}
catch (const std::exception& e)
{
throw;
}
catch (System::Exception^ dotNetException)
{
throw toStdException(dotNetException);
}
}

void OMODFrameworkWrapper::constructorHelper()
Expand Down

0 comments on commit 9eaddc2

Please sign in to comment.