Skip to content

Commit

Permalink
Fix ParseExceptions falling through;
Browse files Browse the repository at this point in the history
Apparently since when the RequestBroker was added, the logic has been changed,
and the exception no longer comes through PreviewController's try{} block.
  • Loading branch information
mniip committed Jan 25, 2014
1 parent f66679e commit 09beafe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
10 changes: 0 additions & 10 deletions src/gui/preview/PreviewController.cpp
Expand Up @@ -62,16 +62,6 @@ void PreviewController::Update()
delete loginWindow;
loginWindow = NULL;
}

try
{
previewModel->Update();
}
catch (PreviewModelException & e)
{
Exit();
new ErrorMessage("Error", e.what());
}
if(previewModel->GetDoOpen() && previewModel->GetSave() && previewModel->GetSave()->GetGameSave())
{
Exit();
Expand Down
3 changes: 2 additions & 1 deletion src/gui/preview/PreviewModel.cpp
Expand Up @@ -2,6 +2,7 @@
#include "PreviewModel.h"
#include "client/Client.h"
#include "client/GameSave.h"
#include "gui/dialogues/ErrorMessage.h"
#include "PreviewModelException.h"

PreviewModel::PreviewModel():
Expand Down Expand Up @@ -174,7 +175,7 @@ void PreviewModel::OnResponseReady(void * object, int identifier)
}
catch(ParseException &e)
{
throw PreviewModelException("Save file corrupt or from newer version");
new ErrorMessage("Error", e.what());
}
notifySaveChanged();
notifyCommentsPageChanged();
Expand Down

0 comments on commit 09beafe

Please sign in to comment.