summaryrefslogtreecommitdiff
path: root/editor/editor_feature_profile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_feature_profile.cpp')
-rw-r--r--editor/editor_feature_profile.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp
index c6646eb28b..145931439a 100644
--- a/editor/editor_feature_profile.cpp
+++ b/editor/editor_feature_profile.cpp
@@ -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;