From b9d19988b94dc8c7d1249b34cd7930ca34d18bda Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 28 Apr 2019 16:09:51 -0400 Subject: [PATCH] rc.lua: Replace the error handling code with request::display_error. It is easier to understand, shorter and more modular. --- awesomerc.lua | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/awesomerc.lua b/awesomerc.lua index 5d2bd2c1..94840722 100644 --- a/awesomerc.lua +++ b/awesomerc.lua @@ -20,34 +20,15 @@ local hotkeys_popup = require("awful.hotkeys_popup") require("awful.hotkeys_popup.keys") -- {{{ Error handling --- @DOC_ERROR_HANDLING@ -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then +naughty.connect_signal("request::display_error", function(message, startup) naughty.notification { - preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - message = awesome.startup_errors + urgency = "critical", + title = "Oops, an error happened"..(startup and " during startup!" or "!"), + message = message } -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notification { - preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - message = tostring(err) - } - - in_error = false - end) -end +end) -- }}} -- {{{ Variable definitions