diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-10-23 23:26:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 23:26:34 +0200 |
commit | 3c69a40caf31e2f383e4b3189c91d6a0f24f5132 (patch) | |
tree | 5d555243aaffc0b34544d6f4f2fbe339b187775a /core/error_macros.cpp | |
parent | ad5613ec40968c553789e0aa97a89dd5432125e3 (diff) | |
parent | a97d7d948b13236209138b7cff76254385e1c90f (diff) |
Merge pull request #12183 from marcelofg55/err_index
Improved *_FAIL_INDEX error macros to print the index/size
Diffstat (limited to 'core/error_macros.cpp')
-rw-r--r-- | core/error_macros.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/error_macros.cpp b/core/error_macros.cpp index 170a22e8dd..7d85aa9001 100644 --- a/core/error_macros.cpp +++ b/core/error_macros.cpp @@ -97,3 +97,10 @@ void _err_print_error(const char *p_function, const char *p_file, int p_line, co _err_error_exists = false; } } + +void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, bool fatal) { + + String fstr(fatal ? "FATAL: " : ""); + String err(fstr + "Index" + p_index_str + "=" + itos(p_index) + " out of size (" + p_size_str + "=" + itos(p_size) + ")"); + _err_print_error(p_function, p_file, p_line, err.utf8().get_data()); +} |