diff options
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 35b44871..225dbf9e 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5302,7 +5302,14 @@ pub const Pardes = struct { pub fn dumpFailed(p: *Pardes, path: []const u8, err: anyerror) void { var what: [limits.host_path_cap + 8]u8 = undefined; const operation = std.fmt.bufPrint(&what, "Dump {s}", .{path}) catch "Dump"; - p.reportError(p.active, operation, err); + // Into a DumpDir that is not there: said so, ENOENT, as a Save is. + const parent = std.fs.path.dirname(path) orelse "/"; + const no_dir = err == error.FileNotFound or err == error.NotDir or + (if (comptime hosted) (if (filesystem.localPath(parent)) |local| !exec.isDirectory(local) else false) else false); + if (no_dir) { + var said: [limits.host_path_cap + 48]u8 = undefined; + p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: no such directory", .{operation}) catch "Dump: no such directory"); + } else p.reportError(p.active, operation, err); // In the words the message row has, so the write's err is the one // record of it (its msg goes: 9p_io, dropMessage). const said = if (p.panes[p.active]) |pane| pane.msg[0..pane.msg_len] else "Dump failed"; |
