summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2023-09-15 12:29:37 +0200
committerRaul Santos <raulsntos@gmail.com>2023-09-15 14:12:01 +0200
commit394c0eb225bd3b9bd0419b3006367d24b34a9a8d (patch)
treeff31812227e339962283fdc8aaf3e9ea900e26e9
parent787259441abb7aa92a382ccf48591a70136f25f0 (diff)
downloadredot-engine-394c0eb225bd3b9bd0419b3006367d24b34a9a8d.tar.gz
C#: Hide hostfxr not found error
Godot tries to find hostfxr in two locations, the method that tries to retrieve the location printed an error when it was not found. So when the first location fails it was printing an error, even if the second location succeeded, and users were left confused thinking there was something wrong with their installation. Now the error will only be printed when stdout verbose is enabled. Users will still get an error later if hostfxr is not found in any of the two locations.
-rw-r--r--modules/mono/editor/hostfxr_resolver.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/mono/editor/hostfxr_resolver.cpp b/modules/mono/editor/hostfxr_resolver.cpp
index 04bd6a9207..4f15335c1e 100644
--- a/modules/mono/editor/hostfxr_resolver.cpp
+++ b/modules/mono/editor/hostfxr_resolver.cpp
@@ -320,7 +320,12 @@ bool get_dotnet_root_from_env(String &r_dotnet_root) {
bool godotsharp::hostfxr_resolver::try_get_path_from_dotnet_root(const String &p_dotnet_root, String &r_fxr_path) {
String fxr_dir = path::join(p_dotnet_root, "host", "fxr");
- ERR_FAIL_COND_V_MSG(!DirAccess::exists(fxr_dir), false, "The host fxr folder does not exist: " + fxr_dir);
+ if (!DirAccess::exists(fxr_dir)) {
+ if (OS::get_singleton()->is_stdout_verbose()) {
+ ERR_PRINT("The host fxr folder does not exist: " + fxr_dir + ".");
+ }
+ return false;
+ }
return get_latest_fxr(fxr_dir, r_fxr_path);
}