aboutsummaryrefslogtreecommitdiff
path: root/riverctl/main.zig
diff options
context:
space:
mode:
authorLeon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de>2023-06-04 06:45:01 +0200
committerIsaac Freund <mail@isaacfreund.com>2023-06-05 20:01:27 +0200
commit93a567ca945bd1f8a04b6453e59e0dbaeed0fcb3 (patch)
treed8f7660e643152da3bed3c91cb9d8fc5986148bd /riverctl/main.zig
parent6e2169a149c6dd537bf0cd2178983bd5b0812d55 (diff)
downloadriver-93a567ca945bd1f8a04b6453e59e0dbaeed0fcb3.tar.gz
river-93a567ca945bd1f8a04b6453e59e0dbaeed0fcb3.tar.xz
riverctl: Add error messages for failed connections
Diffstat (limited to 'riverctl/main.zig')
-rw-r--r--riverctl/main.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/riverctl/main.zig b/riverctl/main.zig
index b3861c3..80f6fb4 100644
--- a/riverctl/main.zig
+++ b/riverctl/main.zig
@@ -47,8 +47,6 @@ pub const Globals = struct {
pub fn main() !void {
_main() catch |err| {
- if (builtin.mode == .Debug) return err;
-
switch (err) {
error.RiverControlNotAdvertised => fatal(
\\The Wayland server does not support river-control-unstable-v1.
@@ -57,6 +55,14 @@ pub fn main() !void {
error.SeatNotAdverstised => fatal(
\\The Wayland server did not advertise any seat.
, .{}),
+ error.ConnectFailed => {
+ std.log.err("Unable to connect to the Wayland server.", .{});
+ if (os.getenvZ("WAYLAND_DISPLAY") == null) {
+ fatal("WAYLAND_DISPLAY is not set.", .{});
+ } else {
+ fatal("Does WAYLAND_DISPLAY contain the socket name of a running server?", .{});
+ }
+ },
else => return err,
}
};