1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-28 16:07:14 +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.

(cherry picked from commit 7839076f95)
This commit is contained in:
Rémi Verschelde
2018-02-19 14:53:59 +01:00
committed by Hein-Pieter van Braam
parent fdac09a0aa
commit f55b376d78
3 changed files with 58 additions and 31 deletions

View File

@@ -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);