1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Improve and document error macros

Documentation can be visible in many IDEs by hovering the macro
anywhere it's used.

Error message styling was also tweaked for consistency.
This commit is contained in:
Hugo Locurcio
2020-01-24 16:53:52 +01:00
parent 97cc2e53f6
commit 37d55ff153
2 changed files with 206 additions and 122 deletions

View File

@@ -106,7 +106,7 @@ void _err_print_error(const char *p_function, const char *p_file, int p_line, co
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, const char *p_message, 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) + ")");
String err(fstr + "Index " + p_index_str + " = " + itos(p_index) + " is out of bounds (" + p_size_str + " = " + itos(p_size) + ").");
_err_print_error(p_function, p_file, p_line, err.utf8().get_data(), p_message);
}