backend: for command not found errors, hint to look in the underlying remote

See: https://forum.rclone.org/t/rclone-cleanup-no-way-to-delete-pending-uploads-newer-than-24-hours/38416/6
This commit is contained in:
Nick Craig-Wood committed 2023-06-10 14:44:01 +01:00
1 parent 1f9c962183
commit 7842000f8a
1 file changed
+7 -1
+7 -1
View File
@@ -98,8 +98,14 @@ Note to run these commands on a running backend then see
out, err = doCommand(context.Background(), name, arg, opt)
}
if err != nil {
if err == fs.ErrorCommandNotFound {
extra := ""
if f.Features().Overlay {
extra = " (try the underlying remote)"
}
return fmt.Errorf("%q %w%s", name, err, extra)
}
return fmt.Errorf("command %q failed: %w", name, err)
}
// Output the result
writeJSON := false