mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-01 20:12:50 +02:00
Fix ParseExceptions falling through;
Apparently since when the RequestBroker was added, the logic has been changed, and the exception no longer comes through PreviewController's try{} block.
This commit is contained in:
@@ -62,16 +62,6 @@ void PreviewController::Update()
|
|||||||
delete loginWindow;
|
delete loginWindow;
|
||||||
loginWindow = NULL;
|
loginWindow = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
previewModel->Update();
|
|
||||||
}
|
|
||||||
catch (PreviewModelException & e)
|
|
||||||
{
|
|
||||||
Exit();
|
|
||||||
new ErrorMessage("Error", e.what());
|
|
||||||
}
|
|
||||||
if(previewModel->GetDoOpen() && previewModel->GetSave() && previewModel->GetSave()->GetGameSave())
|
if(previewModel->GetDoOpen() && previewModel->GetSave() && previewModel->GetSave()->GetGameSave())
|
||||||
{
|
{
|
||||||
Exit();
|
Exit();
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#include "PreviewModel.h"
|
#include "PreviewModel.h"
|
||||||
#include "client/Client.h"
|
#include "client/Client.h"
|
||||||
#include "client/GameSave.h"
|
#include "client/GameSave.h"
|
||||||
|
#include "gui/dialogues/ErrorMessage.h"
|
||||||
#include "PreviewModelException.h"
|
#include "PreviewModelException.h"
|
||||||
|
|
||||||
PreviewModel::PreviewModel():
|
PreviewModel::PreviewModel():
|
||||||
@@ -174,7 +175,7 @@ void PreviewModel::OnResponseReady(void * object, int identifier)
|
|||||||
}
|
}
|
||||||
catch(ParseException &e)
|
catch(ParseException &e)
|
||||||
{
|
{
|
||||||
throw PreviewModelException("Save file corrupt or from newer version");
|
new ErrorMessage("Error", e.what());
|
||||||
}
|
}
|
||||||
notifySaveChanged();
|
notifySaveChanged();
|
||||||
notifyCommentsPageChanged();
|
notifyCommentsPageChanged();
|
||||||
|
Reference in New Issue
Block a user