Skip to content

Commit 48d0fe9

Browse files
committed
absolute_path: print invalid path if canonicalize fails
1 parent 191da0c commit 48d0fe9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

+stdlib/+fileio/absolute_path.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
% UNC path is not canonicalized
2929
continue
3030
end
31-
abspath(i) = string(java.io.File(abspath(i)).getCanonicalPath());
31+
try
32+
abspath(i) = string(java.io.File(abspath(i)).getCanonicalPath());
33+
catch excp
34+
error("stdlib:fileio:absolute_path", "%s is not a canonicalizable path. %s", abspath(i), excp.message)
35+
end
3236
end
3337

3438
end % function

0 commit comments

Comments
 (0)