From 17732fe698b835c29f77c84f329b2ed6cab215ce Mon Sep 17 00:00:00 2001 From: qarmin Date: Wed, 25 Sep 2019 10:28:50 +0200 Subject: Added some obvious errors explanations --- platform/android/export/export.cpp | 6 +++--- platform/android/file_access_jandroid.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'platform/android') diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 441fa38bff..e019e5bd2f 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -598,7 +598,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { String dst_path = String("lib").plus_file(abi).plus_file(p_so.path.get_file()); Vector array = FileAccess::get_file_as_array(p_so.path); Error store_err = store_in_apk(ed, dst_path, array); - ERR_FAIL_COND_V(store_err, store_err); + ERR_FAIL_COND_V_MSG(store_err, store_err, "Cannot store in apk file '" + dst_path + "'."); } } if (!exported) { @@ -1666,7 +1666,7 @@ public: DirAccessRef da = DirAccess::open("res://android"); - ERR_FAIL_COND(!da); + ERR_FAIL_COND_MSG(!da, "Cannot open directory 'res://android'."); Map > directory_paths; Map > manifest_sections; Map > gradle_sections; @@ -1942,7 +1942,7 @@ public: //build project if custom build is enabled String sdk_path = EDITOR_GET("export/android/custom_build_sdk_path"); - ERR_FAIL_COND_V(sdk_path == "", ERR_UNCONFIGURED); + ERR_FAIL_COND_V_MSG(sdk_path == "", ERR_UNCONFIGURED, "Android SDK path must be configured in Editor Settings at 'export/android/custom_build_sdk_path'."); _update_custom_build_project(); diff --git a/platform/android/file_access_jandroid.cpp b/platform/android/file_access_jandroid.cpp index 5b8cf01138..d4c2a23aa0 100644 --- a/platform/android/file_access_jandroid.cpp +++ b/platform/android/file_access_jandroid.cpp @@ -94,13 +94,13 @@ void FileAccessJAndroid::seek(size_t p_position) { JNIEnv *env = ThreadAndroid::get_env(); - ERR_FAIL_COND(!is_open()); + ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use."); env->CallVoidMethod(io, _file_seek, id, p_position); } void FileAccessJAndroid::seek_end(int64_t p_position) { - ERR_FAIL_COND(!is_open()); + ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use."); seek(get_len()); } @@ -108,34 +108,34 @@ void FileAccessJAndroid::seek_end(int64_t p_position) { size_t FileAccessJAndroid::get_position() const { JNIEnv *env = ThreadAndroid::get_env(); - ERR_FAIL_COND_V(!is_open(), 0); + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); return env->CallIntMethod(io, _file_tell, id); } size_t FileAccessJAndroid::get_len() const { JNIEnv *env = ThreadAndroid::get_env(); - ERR_FAIL_COND_V(!is_open(), 0); + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); return env->CallIntMethod(io, _file_get_size, id); } bool FileAccessJAndroid::eof_reached() const { JNIEnv *env = ThreadAndroid::get_env(); - ERR_FAIL_COND_V(!is_open(), 0); + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); return env->CallIntMethod(io, _file_eof, id); } uint8_t FileAccessJAndroid::get_8() const { - ERR_FAIL_COND_V(!is_open(), 0); + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); uint8_t byte; get_buffer(&byte, 1); return byte; } int FileAccessJAndroid::get_buffer(uint8_t *p_dst, int p_length) const { - ERR_FAIL_COND_V(!is_open(), 0); + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); if (p_length == 0) return 0; JNIEnv *env = ThreadAndroid::get_env(); -- cgit v1.2.3