You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 17:36:07 +00:00
Improve error reporting of ProjectSettings::setup()
And use it to better report errors in the console and project manager when a project.godot file is corrupted. Fixes #14963.
This commit is contained in:
@@ -304,8 +304,9 @@ private:
|
||||
|
||||
ProjectSettings *current = memnew(ProjectSettings);
|
||||
|
||||
if (current->setup(dir, "")) {
|
||||
set_message(TTR("Couldn't get project.godot in project path."), MESSAGE_ERROR);
|
||||
int err = current->setup(dir, "");
|
||||
if (err != OK) {
|
||||
set_message(vformat(TTR("Couldn't load project.godot in project path (error %d). It may be missing or corrupted."), err), MESSAGE_ERROR);
|
||||
} else {
|
||||
ProjectSettings::CustomMap edited_settings;
|
||||
edited_settings["application/config/name"] = project_name->get_text();
|
||||
@@ -530,8 +531,9 @@ public:
|
||||
|
||||
ProjectSettings *current = memnew(ProjectSettings);
|
||||
|
||||
if (current->setup(project_path->get_text(), "")) {
|
||||
set_message(TTR("Couldn't get project.godot in the project path."), MESSAGE_ERROR);
|
||||
int err = current->setup(project_path->get_text(), "");
|
||||
if (err != OK) {
|
||||
set_message(vformat(TTR("Couldn't load project.godot in project path (error %d). It may be missing or corrupted."), err), MESSAGE_ERROR);
|
||||
status_rect->show();
|
||||
msg->show();
|
||||
get_ok()->set_disabled(true);
|
||||
|
||||
Reference in New Issue
Block a user