Commit d93d60e4 authored by Erik Reider's avatar Erik Reider

Log errors with G_LOG_LEVEL_CRITICAL instead of aborting

parent 8610d0c0
...@@ -1058,7 +1058,7 @@ namespace SwayNotificationCenter { ...@@ -1058,7 +1058,7 @@ namespace SwayNotificationCenter {
if (write_to_file (path)) { if (write_to_file (path)) {
debug ("Successfully wrote to %s", path); debug ("Successfully wrote to %s", path);
} else { } else {
error ("ERROR WRITING TO %s", path); critical ("ERROR WRITING TO %s", path);
} }
} }
......
...@@ -310,7 +310,7 @@ namespace SwayNotificationCenter { ...@@ -310,7 +310,7 @@ namespace SwayNotificationCenter {
try { try {
swaync_daemon.toggle_dnd (); swaync_daemon.toggle_dnd ();
} catch (Error e) { } catch (Error e) {
error ("Error: %s\n", e.message); critical ("Error: %s\n", e.message);
} }
break; break;
case "Down": case "Down":
......
...@@ -34,7 +34,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -34,7 +34,7 @@ namespace SwayNotificationCenter.Widgets {
try { try {
monitor = fd.monitor (FileMonitorFlags.NONE, null); monitor = fd.monitor (FileMonitorFlags.NONE, null);
} catch (Error e) { } catch (Error e) {
error ("Error %s\n", e.message); critical ("Error %s\n", e.message);
} }
} else { } else {
this.brightness_change (-1); this.brightness_change (-1);
...@@ -47,7 +47,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -47,7 +47,7 @@ namespace SwayNotificationCenter.Widgets {
login1 = Bus.get_proxy_sync (BusType.SYSTEM, login1 = Bus.get_proxy_sync (BusType.SYSTEM,
"org.freedesktop.login1", "/org/freedesktop/login1/session/auto"); "org.freedesktop.login1", "/org/freedesktop/login1/session/auto");
} catch (Error e) { } catch (Error e) {
error ("Error %s\n", e.message); critical ("Error %s\n", e.message);
} }
} }
...@@ -59,7 +59,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -59,7 +59,7 @@ namespace SwayNotificationCenter.Widgets {
connect_monitor (); connect_monitor ();
} else { } else {
this.brightness_change (-1); this.brightness_change (-1);
warning ("Could not find device %s\n", path_current); critical ("Could not find device %s\n", path_current);
close (); close ();
} }
} }
...@@ -100,7 +100,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -100,7 +100,7 @@ namespace SwayNotificationCenter.Widgets {
this.brightness_change (int.parse (data)); this.brightness_change (int.parse (data));
} }
} catch (Error e) { } catch (Error e) {
error ("Error %s\n", e.message); critical ("Error %s\n", e.message);
} }
} }
...@@ -111,7 +111,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -111,7 +111,7 @@ namespace SwayNotificationCenter.Widgets {
string data = dis_max.read_line (null); string data = dis_max.read_line (null);
max = int.parse (data); max = int.parse (data);
} catch (Error e) { } catch (Error e) {
error ("Error %s\n", e.message); critical ("Error %s\n", e.message);
} }
} }
......
...@@ -53,7 +53,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -53,7 +53,7 @@ namespace SwayNotificationCenter.Widgets {
try { try {
swaync_daemon.clear_inhibitors (); swaync_daemon.clear_inhibitors ();
} catch (Error e) { } catch (Error e) {
error ("Error: %s\n", e.message); critical ("Error: %s\n", e.message);
} }
}); });
clear_all_button.set_can_focus (false); clear_all_button.set_can_focus (false);
......
...@@ -134,7 +134,7 @@ namespace SwayNotificationCenter.Widgets.Mpris { ...@@ -134,7 +134,7 @@ namespace SwayNotificationCenter.Widgets.Mpris {
try { try {
setup_mpris (); setup_mpris ();
} catch (Error e) { } catch (Error e) {
error ("MPRIS Widget error: %s", e.message); critical ("MPRIS Widget error: %s", e.message);
} }
} }
......
...@@ -265,8 +265,8 @@ namespace SwayNotificationCenter.Widgets.Mpris { ...@@ -265,8 +265,8 @@ namespace SwayNotificationCenter.Widgets.Mpris {
stream, album_art_cancellable); stream, album_art_cancellable);
album_art_texture = Gdk.Texture.for_pixbuf (pixbuf); album_art_texture = Gdk.Texture.for_pixbuf (pixbuf);
} catch (Error e) { } catch (Error e) {
debug ("Could not download album art for %s. Using fallback...", critical ("Could not download album art for %s. Using fallback... (%s)",
source.media_player.identity); source.media_player.identity, e.message);
} }
if (album_art_texture != null) { if (album_art_texture != null) {
// Set album art // Set album art
......
...@@ -43,7 +43,7 @@ namespace SwayNotificationCenter.Widgets { ...@@ -43,7 +43,7 @@ namespace SwayNotificationCenter.Widgets {
try { try {
swaync_daemon.close_all_notifications (); swaync_daemon.close_all_notifications ();
} catch (Error e) { } catch (Error e) {
error ("Error: %s\n", e.message); critical ("Error: %s\n", e.message);
} }
}); });
if (noti_daemon.control_center != null) { if (noti_daemon.control_center != null) {
......
...@@ -340,14 +340,14 @@ namespace SwayNotificationCenter { ...@@ -340,14 +340,14 @@ namespace SwayNotificationCenter {
if (display is Gdk.Wayland.Display) { if (display is Gdk.Wayland.Display) {
return ((Gdk.Wayland.Display) display).get_wl_display (); return ((Gdk.Wayland.Display) display).get_wl_display ();
} }
GLib.error ("Only supports Wayland!"); error ("Only supports Wayland!");
} }
public static Wl.Surface * get_wl_surface (Gdk.Surface surface) { public static Wl.Surface * get_wl_surface (Gdk.Surface surface) {
if (surface is Gdk.Wayland.Surface) { if (surface is Gdk.Wayland.Surface) {
return ((Gdk.Wayland.Surface) surface).get_wl_surface (); return ((Gdk.Wayland.Surface) surface).get_wl_surface ();
} }
GLib.error ("Only supports Wayland!"); error ("Only supports Wayland!");
} }
public static double lerp (double a, double b, double t) { public static double lerp (double a, double b, double t) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment