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

More descriptive runtime error messages when in debug mode #51

Open
JujuAdams opened this issue Jun 16, 2023 · 1 comment · Fixed by #64
Open

More descriptive runtime error messages when in debug mode #51

JujuAdams opened this issue Jun 16, 2023 · 1 comment · Fixed by #64
Labels
enhancement New feature or request high priority Important

Comments

@JujuAdams
Copy link
Contributor

JujuAdams commented Jun 16, 2023

Ran into a confusing bug when trying to call this code:

draw_text(10, 10, string([1, 2]));

I had forgotten to add string as a function to the environment. Catspeak threw this error out:

___________________________________________
############################################################################################
ERROR in
action number 1
of Draw Event
for object Object1:

script_execute_ext argument 1 incorrect type (undefined) expecting a Number (YYGI32)
 at gml_Script___catspeak_expr_call__ (line 841) -         return script_execute_ext(calleeIdx, args_);
############################################################################################
gml_Script___catspeak_expr_call__ (line 841)
gml_Script_anon___catspeak_expr_call___gml_GlobalScript_scr_catspeak_codegen_25249___catspeak_expr_call___gml_GlobalScript_scr_catspeak_codegen (line 837) -     var args_ = array_map(args, function(f) { return f() });
gml_Script_array_map (line 8) -         _new[@ _i] = _function(_array[_i]);
gml_Script___catspeak_expr_call__ (line 837) -     var args_ = array_map(args, function(f) { return f() });
gml_Script___catspeak_function__ (line 668) -         value = program();
gml_Object_Object1_Draw_0 (line 2) - func();

Figured out what was going on but it'd good to have a clearer error message that'll direct me to the offending function call.

@katsaii katsaii added enhancement New feature or request high priority Important labels Jun 16, 2023
@katsaii katsaii changed the title Would be helpful to have a specific error message when calling a function that doesn't exist More descriptive runtime error messages when in debug mode Jun 23, 2023
@katsaii katsaii moved this to Todo in Catspeak 3.0.0 Jun 24, 2023
@katsaii katsaii linked a pull request Jun 24, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from Todo to Done in Catspeak 3.0.0 Jun 24, 2023
@katsaii
Copy link
Owner

katsaii commented Jul 12, 2024

Errors still kind of suck.

@katsaii katsaii reopened this Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority Important
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants