godotengine / godotengine/godot
Godot reports "failed to load" on load the file, but the file loads correctly
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.5.dev4.official [209a446e3]
### System information
w10 64
### Issue description
When Godot loads a project and one of the scripts contains a code error, it reports a load failure, even though the script itself is loaded correctly.
The error Godot shows is "failed to load script," which is supposed to be a file loading error, but it actually turns out to be a code error in the script.
This message from Godot mixes two separate issues: a code error and a file load error.
The message is unclear and causes confusion.
In my opinion, if it helps at all, this code error should not be reported as a "file load error." In fact, it shouldn’t even trigger a message like the one shown in the attached image during project loading. The project loading process should load the files and nothing more; it shouldn’t check for code errors.
It could show error messages related to file loading, for example with corrupted files, but it shouldn’t go beyond that.

This is the script causing the message.

### Steps to reproduce
Load a project that has an issue in one of its scripts.
### Minimal reproduction project (MRP)
...
Contributor guide
Assessment
This issue has not been assessed yet.