From a97d7d948b13236209138b7cff76254385e1c90f Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Tue, 17 Oct 2017 11:37:40 -0300 Subject: Improved *_FAIL_INDEX error macros to print the index/size --- core/error_macros.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/error_macros.cpp') 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()); +} -- cgit v1.2.3