mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
creating a font with faulty data now throws an exception; error handler now wraps error text if it's too long
This commit is contained in:
@@ -210,7 +210,12 @@ namespace opengl
|
||||
// Second optional parameter can be a number:
|
||||
int size = luaL_optint(L, 2, 12);
|
||||
|
||||
Font * font = instance->newFont(d, size);
|
||||
Font * font;
|
||||
try {
|
||||
font = instance->newFont(d, size);
|
||||
} catch (Exception & e) {
|
||||
return luaL_error(L, e.what());
|
||||
}
|
||||
|
||||
if(font == 0)
|
||||
return luaL_error(L, "Could not load the font");
|
||||
|
||||
Reference in New Issue
Block a user