Catch exceptions thrown while encoding image data (issue #282)

This commit is contained in:
Bart van Strien
2011-08-22 18:07:50 +02:00
parent efb04ab27c
commit ceab3f7a44
+8 -1
View File
@@ -157,7 +157,14 @@ namespace image
}
ImageData::Format format;
ImageData::getConstant(fmt, format);
t->encode(file, format);
try
{
t->encode(file, format);
}
catch (love::Exception & e)
{
return luaL_error(L, e.what());
}
return 0;
}