summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-03-14 09:21:31 +0100
committerGitHub <noreply@github.com>2018-03-14 09:21:31 +0100
commitdb289e0e85a55b1101604679883bfd21658b2660 (patch)
tree833d604d6935463540e25ead0c10399125a3c3d5 /editor
parentc90f18e3f5e99c38623dc1c28a2b71c1678a0a5a (diff)
parent06e537fec5a4c4ed16a2f3b616c59d19be573c60 (diff)
Merge pull request #17420 from marcelofg55/fscache_err_checks
Added error checks for fscache saving
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_file_system.cpp20
-rw-r--r--editor/editor_settings.cpp7
2 files changed, 16 insertions, 11 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 27d086d19e..d8ae1da72e 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -275,9 +275,13 @@ void EditorFileSystem::_scan_filesystem() {
memdelete(d);
f = FileAccess::open(fscache, FileAccess::WRITE);
- _save_filesystem_cache(new_filesystem, f);
- f->close();
- memdelete(f);
+ if (f == NULL) {
+ ERR_PRINTS("Error writing fscache: " + fscache);
+ } else {
+ _save_filesystem_cache(new_filesystem, f);
+ f->close();
+ memdelete(f);
+ }
scanning = false;
}
@@ -286,9 +290,13 @@ void EditorFileSystem::_save_filesystem_cache() {
String fscache = EditorSettings::get_singleton()->get_project_settings_dir().plus_file("filesystem_cache3");
FileAccess *f = FileAccess::open(fscache, FileAccess::WRITE);
- _save_filesystem_cache(filesystem, f);
- f->close();
- memdelete(f);
+ if (f == NULL) {
+ ERR_PRINTS("Error writing fscache: " + fscache);
+ } else {
+ _save_filesystem_cache(filesystem, f);
+ f->close();
+ memdelete(f);
+ }
}
void EditorFileSystem::_thread_func(void *_userdata) {
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 905ee81ec8..3a75673560 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -963,11 +963,8 @@ void EditorSettings::save() {
Error err = ResourceSaver::save(singleton->config_file_path, singleton);
if (err != OK) {
- ERR_PRINT("Can't Save!");
- return;
- }
-
- if (OS::get_singleton()->is_stdout_verbose()) {
+ ERR_PRINTS("Error saving editor settings to " + singleton->config_file_path);
+ } else if (OS::get_singleton()->is_stdout_verbose()) {
print_line("EditorSettings Save OK!");
}
}