Merge pull request #384 from blueyed/more-robust-errors
More robust errors: make sure errors are strings Closes https://github.com/awesomeWM/awesome/pull/384.
This commit is contained in:
commit
4e22cf02e6
|
@ -69,8 +69,8 @@ function textbox:set_markup(text)
|
|||
end
|
||||
|
||||
local attr, parsed = Pango.parse_markup(text, -1, 0)
|
||||
-- In case of error, attr is false and parsed is an error message
|
||||
if not attr then error(parsed) end
|
||||
-- In case of error, attr is false and parsed is a GLib.Error instance.
|
||||
if not attr then error(parsed.message or tostring(parsed)) end
|
||||
|
||||
self._markup = text
|
||||
self._layout.text = parsed
|
||||
|
|
4
luaa.c
4
luaa.c
|
@ -323,6 +323,10 @@ luaA_panic(lua_State *L)
|
|||
static int
|
||||
luaA_dofunction_on_error(lua_State *L)
|
||||
{
|
||||
#if LUA_VERSION_NUM >= 502
|
||||
/* Convert error to string, to prevent a follow-up error with lua_concat. */
|
||||
luaL_tolstring(L, -1, NULL);
|
||||
#endif
|
||||
/* duplicate string error */
|
||||
lua_pushvalue(L, -1);
|
||||
/* emit error signal */
|
||||
|
|
Loading…
Reference in New Issue