Skip to content

Commit

Permalink
Update variant__call error message to include Variant type found
Browse files Browse the repository at this point in the history
  • Loading branch information
gilzoide committed Oct 14, 2023
1 parent bc01b9f commit f3b8b77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/luaopen/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ bool variant_is(const Variant& variant, const sol::stack_object& type) {
}

sol::stack_object variant__call(sol::this_state L, const Variant& variant, sol::variadic_args args) {
ERR_FAIL_COND_V_MSG(variant.get_type() != Variant::CALLABLE, to_lua(L, Variant()), "Variant must be a Callable to be called.");
ERR_FAIL_COND_V_MSG(
variant.get_type() != Variant::CALLABLE,
to_lua(L, Variant()),
String("attempt to call a %s value") % get_type_name(variant)
);
VariantArguments var_args = args;
Callable callable = variant;
Variant result = callable.callv(var_args.get_array());
Expand Down

0 comments on commit f3b8b77

Please sign in to comment.