Exceptions are caught in open/save command threads.

This commit is contained in:
David Capello 2010-03-28 15:47:22 -03:00
parent 129d5a9b13
commit 5c2d31f3fe
2 changed files with 12 additions and 2 deletions

View File

@ -70,7 +70,12 @@ static void openfile_bg(void *fop_data)
{
FileOp* fop = (FileOp*)fop_data;
fop_operate(fop);
try {
fop_operate(fop);
}
catch (const std::exception& e) {
fop_error(fop, _("Error loading file:\n%s"), e.what());
}
if (fop_is_stop(fop) && fop->sprite) {
delete fop->sprite;

View File

@ -50,7 +50,12 @@ typedef struct SaveFileData
static void savefile_bg(void *fop_data)
{
FileOp *fop = (FileOp *)fop_data;
fop_operate(fop);
try {
fop_operate(fop);
}
catch (const std::exception& e) {
fop_error(fop, _("Error saving file:\n%s"), e.what());
}
fop_done(fop);
}