Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In C#, Polling for InputMap action that does not exist produces a difficult to debug error. #79449

Closed
hudmarc opened this issue Jul 13, 2023 · 2 comments · Fixed by #79280
Closed

Comments

@hudmarc
Copy link

hudmarc commented Jul 13, 2023

Godot version

v4.1.stable.mono.official [9704596]

System information

Godot v4.1.stable.mono - macOS 13.4.1 - Vulkan (Mobile) - dedicated AMD Radeon Pro 5300M - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 Threads)

Issue description

When polling for an InputAction that does not exist from C#, Godot produces the following error, which is so long that it is impossible to read on a normal display.

E 0:00:01:0823   Godot.NativeInterop.NativeFuncs.generated.cs:345 @ void Godot.NativeInterop.NativeFuncs.godotsharp_method_bind_ptrcall(IntPtr , IntPtr , System.Void** , System.Void* ): The InputMap action "Jump" doesn't exist.

The expected error in this case would be something along the lines of

Error: The InputMap action "Jump" doesn't exist.

But instead this is what the console ends up looking like:
image

Steps to reproduce

Poll an Action that does not exist in C#:

Input.GetActionStrength(action_name);

The resulting error should be very difficult to parse.

Minimal reproduction project

This is a very simple error to reproduce (simply poll for a nonexistent Action with C#) so I don't think a reproduction project is necessary.

@hudmarc hudmarc changed the title Polling for InputMap action that does not exist produces difficult to debug error in C# In C#, Polling for InputMap action that does not exist produces a difficult to debug error. Jul 13, 2023
@hudmarc
Copy link
Author

hudmarc commented Jul 13, 2023

Perhaps an easy fix for this would be to truncate errors produced by C# interop up to the actual message, with the option to view the full stack trace when clicking on the error?

@Calinou
Copy link
Member

Calinou commented Jul 13, 2023

See #71943.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants