Suggestion for more useful runtime error messages

74 views
Skip to first unread message
Assigned to halab...@google.com by taifu...@gmail.com

Ted Inoue

unread,
Mar 6, 2014, 11:01:32 AM3/6/14
to mitappinv...@googlegroups.com
Working on Windows 7. Developing for a Nexus 5.

Comments applicable to AppInventor environment

Developing a full-featured app with several screens and lots of procedures.

Here's the problem - During runtime, I was getting an error message about accessing list items, something like I tried to access list element 1 but the list had 0 entries. This was odd as my code was checking for an empty list just prior to the suspected bad code.

After about a half day of debugging, putting in alert dialogs and so forth, I found the error in a different piece of code. I was actually doing a "lookup in pairs" and had inserted a closing " in the string, so the defined string was something like "foo"" instead of "foo"

I would have found the error much sooner (like seconds instead of hours) if the error message provided just a couple of pieces of information:
  • The screen and procedure in which the error occurred. I.e. screen: screen1, procedure: myFunction1
  • The actual function call that caused the error. I.e list:lookup_in_pairs
  • The parameters passed to the function: i.e. key: "foo"", pairs: bar, not found: ""
Any one of these would have helped a lot. All three would have made it immediately obvious where the error lay.

Thanks!

fturbak

unread,
Mar 6, 2014, 11:43:49 PM3/6/14
to mitappinv...@googlegroups.com, Johanna L Okerlund
Hi, Ted --

Thanks for these suggestions. I am forwarding them to Johanna Okerlund, who is implementing improvements to the AI2 error system. One of her improvements is to show the block that is causing the error, which would have helped a lot in your case. But better error messages are also important. 

- lyn -
Reply all
Reply to author
Forward
0 new messages