From 8b2ecc90ff565fa571f0fed60646b592629825c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E9=9D=92=E5=B1=B1?= Date: Wed, 13 Nov 2024 09:16:07 +0800 Subject: [PATCH] Print an error message when a call to `Callable::callv()` fails Make it similar to `Object::callv()`. --- core/variant/callable.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/variant/callable.cpp b/core/variant/callable.cpp index ddeea2711842..9addbfaf30fa 100644 --- a/core/variant/callable.cpp +++ b/core/variant/callable.cpp @@ -82,6 +82,9 @@ Variant Callable::callv(const Array &p_arguments) const { CallError ce; Variant ret; callp(argptrs, argcount, ret, ce); + if (ce.error != CallError::CALL_OK) { + ERR_FAIL_V_MSG(ret, vformat("Error calling method from 'callv': %s.", Variant::get_call_error_text(get_object(), get_method(), argptrs, argcount, ce))); + } return ret; }