diff options
Diffstat (limited to 'core/os/file_access.cpp')
-rw-r--r-- | core/os/file_access.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 079f51bada..b5580b5c6e 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -600,9 +600,9 @@ Vector<uint8_t> FileAccess::get_file_as_array(const String &p_path, Error *r_err if (!f) { if (r_error) { // if error requested, do not throw error return Vector<uint8_t>(); - } else { - ERR_FAIL_COND_V(!f, Vector<uint8_t>()); } + ERR_EXPLAIN("Can't open file from path: " + String(p_path)); + ERR_FAIL_V(Vector<uint8_t>()); } Vector<uint8_t> data; data.resize(f->get_len()); @@ -621,9 +621,9 @@ String FileAccess::get_file_as_string(const String &p_path, Error *r_error) { if (err != OK) { if (r_error) { return String(); - } else { - ERR_FAIL_COND_V(err != OK, String()); } + ERR_EXPLAIN("Can't get file as string from path: " + String(p_path)); + ERR_FAIL_V(String()); } String ret; |