godot
godot copied to clipboard
DirAccess does not give useful errors (even though there's supposed to be support for them)
Tested versions
Tested and reproduced in 4.2.1.stable
System information
Godot v4.2.1.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated AMD Radeon RX 5700 XT (Advanced Micro Devices, Inc.; 31.0.24027.1012) - AMD Ryzen 5 2600 Six-Core Processor (12 Threads)
Issue description
Essentially I was failing to get DirAccess working and I noticed that it always throws @GlobalScope.FAILED aka Error 1.
Steps to reproduce
Try to rename a file with
var path = YOUR_PATH_HERE
var from = FILE_NAME_AT_START
var to = FILE_NAME_AFTER_RENAME
var da = DirAccess.open(path)
da.rename(from, to)
but fail to rename the file, have an incorrect path or something that will throw an error, the error will ALWAYS be Error 1
Minimal reproduction project (MRP)
I forgot to link this, Godot DirAccess Engine File.