As discussed on chat with @RPicster and @rburing, the "area monitor callback" which can be defined via PhysicsServer for Area2D/3D doesn't seem to do proper error reporting/validation of the callback defined by the user.
So it can make it hard to know that e.g. one passed a callback with the wrong arity (number of parameter).
Object::emit_signal properly flags such errors for example (albeit with a not super-friendly error, which could be improved too (#12450)):
E 0:00:00.401 emit_signal: Error calling method from signal 'mysignal': 'Spatial(Spatial.gd)::_on_my_signal': Method expected 2 arguments, but called with 1..
<Source C++> core/object.cpp:1236 @ emit_signal()
<Call Stack>Spatial.gd:13 @ _ready()
From a quick look at AreaSW (GodotPhysics) in 3.x, it does seem to skip reporting call errors indeed:
Godot version
3.x (e80a8be)
System information
Linux, Mageia 9 x86_64
Issue description
As discussed on chat with @RPicster and @rburing, the "area monitor callback" which can be defined via PhysicsServer for Area2D/3D doesn't seem to do proper error reporting/validation of the callback defined by the user.
So it can make it hard to know that e.g. one passed a callback with the wrong arity (number of parameter).
Object::emit_signalproperly flags such errors for example (albeit with a not super-friendly error, which could be improved too (#12450)):From a quick look at AreaSW (GodotPhysics) in
3.x, it does seem to skip reporting call errors indeed:godot/servers/physics/area_sw.cpp
Lines 265 to 266 in e80a8be
Assuming that this is the proper location to handle such check, it likely needs to be done for GodotPhysics 2D and 3D as well as Bullet.
Didn't check
master, might have the same issue.Steps to reproduce
Code from @RPicster, not a minimal project per se but making one shouldn't be too difficult:
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: