diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-09-25 11:51:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-25 11:51:54 +0200 |
commit | dec10dd776fca2994277faa3a97b13e70317f784 (patch) | |
tree | cea7622b2e2bb0d2cede33274807cb98b4fef856 /core/os/file_access.cpp | |
parent | de03ee94cc4df1a451c6f64e984b1da307d0f4b4 (diff) | |
parent | 17732fe698b835c29f77c84f329b2ed6cab215ce (diff) | |
download | redot-engine-dec10dd776fca2994277faa3a97b13e70317f784.tar.gz |
Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
Diffstat (limited to 'core/os/file_access.cpp')
-rw-r--r-- | core/os/file_access.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 9a8315a3bb..738e597730 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -498,7 +498,7 @@ uint64_t FileAccess::get_modified_time(const String &p_file) { return 0; FileAccess *fa = create_for_path(p_file); - ERR_FAIL_COND_V(!fa, 0); + ERR_FAIL_COND_V_MSG(!fa, 0, "Cannot create FileAccess for path '" + p_file + "'."); uint64_t mt = fa->_get_modified_time(p_file); memdelete(fa); @@ -511,7 +511,7 @@ uint32_t FileAccess::get_unix_permissions(const String &p_file) { return 0; FileAccess *fa = create_for_path(p_file); - ERR_FAIL_COND_V(!fa, 0); + ERR_FAIL_COND_V_MSG(!fa, 0, "Cannot create FileAccess for path '" + p_file + "'."); uint32_t mt = fa->_get_unix_permissions(p_file); memdelete(fa); @@ -521,7 +521,7 @@ uint32_t FileAccess::get_unix_permissions(const String &p_file) { Error FileAccess::set_unix_permissions(const String &p_file, uint32_t p_permissions) { FileAccess *fa = create_for_path(p_file); - ERR_FAIL_COND_V(!fa, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(!fa, ERR_CANT_CREATE, "Cannot create FileAccess for path '" + p_file + "'."); Error err = fa->_set_unix_permissions(p_file, p_permissions); memdelete(fa); @@ -599,7 +599,7 @@ Vector<uint8_t> FileAccess::get_file_as_array(const String &p_path, Error *r_err if (r_error) { // if error requested, do not throw error return Vector<uint8_t>(); } - ERR_FAIL_V_MSG(Vector<uint8_t>(), "Can't open file from path: " + String(p_path) + "."); + ERR_FAIL_V_MSG(Vector<uint8_t>(), "Can't open file from path '" + String(p_path) + "'."); } Vector<uint8_t> data; data.resize(f->get_len()); @@ -619,7 +619,7 @@ String FileAccess::get_file_as_string(const String &p_path, Error *r_error) { if (r_error) { return String(); } - ERR_FAIL_V_MSG(String(), "Can't get file as string from path: " + String(p_path) + "."); + ERR_FAIL_V_MSG(String(), "Can't get file as string from path '" + String(p_path) + "'."); } String ret; |