summaryrefslogtreecommitdiff
path: root/modules/gdnative/pluginscript/pluginscript_script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdnative/pluginscript/pluginscript_script.cpp')
-rw-r--r--modules/gdnative/pluginscript/pluginscript_script.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp
index 3ecb29404a..b82823ab64 100644
--- a/modules/gdnative/pluginscript/pluginscript_script.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_script.cpp
@@ -35,16 +35,14 @@
#include "pluginscript_script.h"
#ifdef DEBUG_ENABLED
-#define __ASSERT_SCRIPT_REASON "Cannot retrieve pluginscript class for this script, is you code correct ?"
-#define ASSERT_SCRIPT_VALID() \
- { \
- ERR_EXPLAIN(__ASSERT_SCRIPT_REASON); \
- ERR_FAIL_COND(!can_instance()); \
+#define __ASSERT_SCRIPT_REASON "Cannot retrieve PluginScript class for this script, is your code correct?"
+#define ASSERT_SCRIPT_VALID() \
+ { \
+ ERR_FAIL_COND_MSG(!can_instance(), __ASSERT_SCRIPT_REASON); \
}
-#define ASSERT_SCRIPT_VALID_V(ret) \
- { \
- ERR_EXPLAIN(__ASSERT_SCRIPT_REASON); \
- ERR_FAIL_COND_V(!can_instance(), ret); \
+#define ASSERT_SCRIPT_VALID_V(ret) \
+ { \
+ ERR_FAIL_COND_V_MSG(!can_instance(), ret, __ASSERT_SCRIPT_REASON); \
}
#else
#define ASSERT_SCRIPT_VALID()
@@ -197,8 +195,7 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) {
// if (ScriptDebugger::get_singleton()) {
// _language->debug_break_parse(get_path(), 0, msg);
// }
- ERR_EXPLAIN(msg);
- ERR_FAIL_V(NULL);
+ ERR_FAIL_V_MSG(NULL, msg);
}
}
@@ -272,8 +269,7 @@ Error PluginScript::reload(bool p_keep_state) {
_ref_base_parent = res;
} else {
String name = *(StringName *)&manifest.name;
- ERR_EXPLAIN(_path + ": Script '" + name + "' has an invalid parent '" + *base_name + "'.");
- ERR_FAIL_V(ERR_PARSE_ERROR);
+ ERR_FAIL_V_MSG(ERR_PARSE_ERROR, _path + ": Script '" + name + "' has an invalid parent '" + *base_name + "'.");
}
}
}
@@ -420,8 +416,7 @@ Error PluginScript::load_source_code(const String &p_path) {
String s;
if (s.parse_utf8((const char *)w.ptr())) {
- ERR_EXPLAIN("Script '" + p_path + "' contains invalid unicode (utf-8), so it was not loaded. Please ensure that scripts are saved in valid utf-8 unicode.");
- ERR_FAIL_V(ERR_INVALID_DATA);
+ ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode.");
}
_source = s;