Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (Retired) Slices sillyCase

Ben Thomas
Ben Thomas
1,911 Points

Error throws are buggy

I've noticed that the error messages thrown by the code quizzes are very inaccurate. For example, when I def a function "def sillycase():" and it works improperly, the quiz editor throws "Bummer! Where's sillycase()?" OK, my function has a bug, that's fine; but don't tell me the function isn't there at all when I can clearly see that I've defined it.

Other code quizzes throw errors that are bizarre/inaccurate in other ways - for example, if a function I'm writing for a step 2 or 3 fails, step 1 throws an error too; even if step 1's code passes when I delete the steps lower down.

1 Answer

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

To address the last part first, every time you submit code, it's run through all of the previous steps and the current one. So if you introduce a show-stopping error on step 3, step 1 will fail.

As for the function not being found, if the function has an exception in it that causes the script to stop executing, the function won't ever be registered with Python so it literally isn't there as far as the process is concerned.

Ben Thomas
Ben Thomas
1,911 Points

I understand both your points - if something in the function or one of the subsequent steps fails, the code as a whole will fail.

The problem I'm having with this generalized style of error-handling is that it effectively makes the debugging process a guessing game - by contrast, if I write some invalid syntax within the IDLE shell, the shell will tell me exactly where the syntax error is, and even highlight it for me. If there's another type of error, the shell will tell me which line it's in, and what type of error it is. For this reason, I often end up turning to IDLE to debug my code for the quizzes, because there's no way to pinpoint bugs with Treehouse's style of error reporting.

Does this make sense?

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

I completely understand, Ben Thomas. I get frustrated with our CCs sometimes, too.

The text editor in Workspaces is a bit more full-featured than the one in the CCs, so you might try problem code there first, or, as you seem to be doing, IDLE and other desktop apps work great, too.