mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
This commit is contained in:
@@ -165,7 +165,7 @@ Error EditorFeatureProfile::save_to_file(const String &p_path) {
|
||||
json["disabled_features"] = dis_features;
|
||||
|
||||
FileAccessRef f = FileAccess::open(p_path, FileAccess::WRITE);
|
||||
ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
|
||||
ERR_FAIL_COND_V_MSG(!f, ERR_CANT_CREATE, "Cannot create file '" + p_path + "'.");
|
||||
|
||||
String text = JSON::print(json, "\t");
|
||||
f->store_string(text);
|
||||
@@ -326,7 +326,8 @@ void EditorFeatureProfileManager::_update_profile_list(const String &p_select_pr
|
||||
|
||||
Vector<String> profiles;
|
||||
DirAccessRef d = DirAccess::open(EditorSettings::get_singleton()->get_feature_profiles_dir());
|
||||
ERR_FAIL_COND(!d);
|
||||
ERR_FAIL_COND_MSG(!d, "Cannot open directory '" + EditorSettings::get_singleton()->get_feature_profiles_dir() + "'.");
|
||||
|
||||
d->list_dir_begin();
|
||||
while (true) {
|
||||
String f = d->get_next();
|
||||
@@ -433,7 +434,8 @@ void EditorFeatureProfileManager::_erase_selected_profile() {
|
||||
String selected = _get_selected_profile();
|
||||
ERR_FAIL_COND(selected == String());
|
||||
DirAccessRef da = DirAccess::open(EditorSettings::get_singleton()->get_feature_profiles_dir());
|
||||
ERR_FAIL_COND(!da);
|
||||
ERR_FAIL_COND_MSG(!da, "Cannot open directory '" + EditorSettings::get_singleton()->get_feature_profiles_dir() + "'.");
|
||||
|
||||
da->remove(selected + ".profile");
|
||||
if (selected == current_profile) {
|
||||
_profile_action(PROFILE_CLEAR);
|
||||
@@ -672,7 +674,7 @@ void EditorFeatureProfileManager::_update_selected_profile() {
|
||||
//reload edited, if different from current
|
||||
edited.instance();
|
||||
Error err = edited->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(profile + ".profile"));
|
||||
ERR_FAIL_COND(err != OK);
|
||||
ERR_FAIL_COND_MSG(err != OK, "Error when loading EditorSettings from file '" + EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(profile + ".profile") + "'.");
|
||||
}
|
||||
|
||||
updating_features = true;
|
||||
|
||||
Reference in New Issue
Block a user