summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index bc9bb075..89d89c3a 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -790,10 +790,15 @@ pub const Mount = struct {
pub fn run(c: Ctx) void {
if (comptime !enabled) unreachable;
var args = std.mem.tokenizeAny(u8, c.arg orelse "", " \t");
- const name = args.next() orelse return c.p.reportError(c.id, "Mount name dial", error.MissingArgument);
+ const e_args = "wrong #args in control message \"Mount\": Mount name dial";
+ const name = args.next() orelse return c.p.reportFailure(c.id, e_args);
const dial = std.mem.trim(u8, args.rest(), " \t");
- if (dial.len == 0) return c.p.reportError(c.id, "Mount name dial", error.MissingArgument);
- c.p.fs.mount(c.p.gpa, name, dial) catch |err| return c.p.reportError(c.id, "Mount", err);
+ if (dial.len == 0) return c.p.reportFailure(c.id, e_args);
+ c.p.fs.mount(c.p.gpa, name, dial) catch |err| {
+ var said: [200]u8 = undefined;
+ if (err == error.BadDial) return c.p.reportFailure(c.id, std.fmt.bufPrint(&said, "Mount: bad dial address: {s} (unix!/path, tcp!host!port, or a session name)", .{dial[0..@min(dial.len, 100)]}) catch "Mount: bad dial address");
+ return c.p.reportError(c.id, "Mount", err);
+ };
// A mount that cannot be reached is said now, and taken back, not
// found out by the first look through it.
const reached = reached: {