summaryrefslogtreecommitdiff
path: root/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-09-25 10:28:50 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-09-25 10:28:50 +0200
commit17732fe698b835c29f77c84f329b2ed6cab215ce (patch)
treeb95c08185e886dc6410ba8646e5ff839382b4e01 /editor/plugins/script_editor_plugin.cpp
parente9f49a6d5ac88a6afca8a16f91a05f4fcdf5a589 (diff)
Added some obvious errors explanations
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r--editor/plugins/script_editor_plugin.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 8b6bab374c..e43528a79e 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1965,7 +1965,7 @@ Ref<TextFile> ScriptEditor::_load_text_file(const String &p_path, Error *r_error
Ref<TextFile> text_res(text_file);
Error err = text_file->load_text(path);
- ERR_FAIL_COND_V(err != OK, RES());
+ ERR_FAIL_COND_V_MSG(err != OK, RES(), "Cannot load text file '" + path + "'.");
text_file->set_file_path(local_path);
text_file->set_path(local_path, true);
@@ -1990,10 +1990,7 @@ Error ScriptEditor::_save_text_file(Ref<TextFile> p_text_file, const String &p_p
Error err;
FileAccess *file = FileAccess::open(p_path, FileAccess::WRITE, &err);
- if (err) {
-
- ERR_FAIL_COND_V(err, err);
- }
+ ERR_FAIL_COND_V_MSG(err, err, "Cannot save text file '" + p_path + "'.");
file->store_string(source);
if (file->get_error() != OK && file->get_error() != ERR_FILE_EOF) {