diff options
author | Marcelo Fernandez <marcelofg55@gmail.com> | 2017-10-17 11:37:40 -0300 |
---|---|---|
committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2017-10-22 12:17:41 -0300 |
commit | a97d7d948b13236209138b7cff76254385e1c90f (patch) | |
tree | 1187f55266f8c7fec039f87b8607692f2c068557 /core/error_macros.cpp | |
parent | 6e960c7d6bbf7481bae41ab0ebb39bc75619272a (diff) |
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()); +} |