textbox.set_markup: handle `parsed.message` from Pango.parse_markup

Ref: https://github.com/pavouk/lgi/issues/115
Fixes: https://github.com/awesomeWM/awesome/issues/301
This commit is contained in:
Daniel Hahler 2015-08-01 18:25:10 +02:00
parent 5c446c9c09
commit 5b60bc212a
1 changed files with 2 additions and 2 deletions

View File

@ -63,8 +63,8 @@ function textbox:set_markup(text)
end end
local attr, parsed = Pango.parse_markup(text, -1, 0) local attr, parsed = Pango.parse_markup(text, -1, 0)
-- In case of error, attr is false and parsed is an error message -- In case of error, attr is false and parsed is a GLib.Error instance.
if not attr then error(parsed) end if not attr then error(parsed.message or tostring(parsed)) end
self._markup = text self._markup = text
self._layout.text = parsed self._layout.text = parsed