Can't suppress error in #12585 with a try
#12586
Labels
error-handling
How errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)
file-system
Related to commands and core nushell behavior around the file system
needs-triage
An issue that hasn't had any proper look
Describe the bug
I came across this when answering Question #12560, but I believe there are two issues at play. This is the second part of the issue. The first part is in #12585.
Given the error condition in #12585, I had hoped to suppress it with
try { rm -rf $in.name}
, but it occurs anyway.How to reproduce
Using a slightly modified version of the test code in #12585, wrap the
rm
attempt in atry
:However, the error still appears.
Expected behavior
Just as with
try { rm fileDoesntExist }
, I would expect to be able to suppress the error.Screenshots
No response
Configuration
Additional context
Perhaps this is just expected, since it is an internal error condition rather than a script error. However, given the formatting of the error, it "looks like" an error that could be handled with
try
.The text was updated successfully, but these errors were encountered: