Skip to content

Callable not throwing any errors #1123

@aekobear

Description

@aekobear

On gdext 0.2.4 this code properly throws errors:

  let instance: Gd<Node> = whatever;
  
  // error because function is not defined
  instance.call("_not_real", &[]); 
  // error because function def has a parameter
  instance.call("_param_required", &[]);

But when using the Callable, all failures are silent:

  let instance: Gd<Node> = whatever;

  // nothing happens
  instance.callable("_not_real").call(&[]);
  // nothing happens
  instance.callable("_param_required", &[]);

I would expect callable.call() here to throw the same errors that instance.call and gdscript's Callable().call() do. It would also be awesome to have a result on callable, though this deviates from gdscript's behavior:

let Some(callable) = instance.callable("_not_real") else {
  println!("method not found!");
  return;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: coreCore componentsc: ffiLow-level components and interaction with GDExtension APIfeatureAdds functionality to the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions