benjie-git / CardStock

CardStock is a cross-platform tool for quickly and easily building programs. It provides a drawing-program-like editor for visually laying out your programs' parts, and a code editor for adding event-driven python code.
Mozilla Public License 2.0
249 stars 9 forks source link

Add index error for goto card out of bounds #4

Closed kball closed 3 years ago

kball commented 3 years ago

Summary Prior to this change, using GotoCard with an out of bounds index resulted in a python backtrace, hard-to-read (for new programmers) error, and the error not being added to the errors buffer (because it happened on main thread). After the change, error message is descriptive and added to errors buffer.

Test Plan To reproduce, simply use GotoCard(100) in an event handler in the default/readme stack