godotengine / godotengine/godot

DirAccess does not give useful errors (even though there's supposed to be support for them)

Open
#91,640 1 comment 0 reactions 0 assignees View on GitHub
bug topic:core
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### 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
```gdscript
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)

[MRP_DirAccess_Error_Codes.zip](https://github.com/godotengine/godot/files/15227729/MRP_DirAccess_Error_Codes.zip)

Contributor guide

Open the contributing guide

Research direction

Start at the DirAccess.rename entry point and reproduce the failures using the supplied MRP_DirAccess_Error_Codes.zip project. Compare the reported Error 1 result for an invalid path or failed rename, and define completion as returning useful, distinguishable errors for these cases.

Written by the indexing model from the issue text.

Assessment

Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.