diff options
author | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-03-10 16:47:10 -0300 |
---|---|---|
committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-03-13 13:15:03 -0300 |
commit | 06e537fec5a4c4ed16a2f3b616c59d19be573c60 (patch) | |
tree | 10af5b8d2d55115d7f305365c0db7daf54433490 | |
parent | 93a3d1714ee9b1535ac8f902bd7b2b3135712b90 (diff) |
Added error checks for fscache saving
-rw-r--r-- | editor/editor_file_system.cpp | 20 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 7 |
2 files changed, 16 insertions, 11 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index a6fc8dcddf..115d09f00f 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -274,9 +274,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; } @@ -285,9 +289,13 @@ void EditorFileSystem::_save_filesystem_cache() { String fscache = EditorSettings::get_singleton()->get_project_settings_path().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 bc91fcdf04..7c3df5c78b 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -856,11 +856,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!"); } } |