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 Basics Functions and Looping Raising Exceptions

How To Make Raised Exceptions Look "Clean" When Getting ValueErrors In VSCode

I have a pretty solid function I created to determine a "parabolic age" which actually means nothing.

I made it in VSCode, however I have it laid out in a way that seems to be identical to the way it is in this video as far as the try block, except block and else block.

However, no matter what I do, I can't get a "clean" error message like Craig does at the end of this video.

I get the error: "Traceback (most recent call last): File "parabolic_age_function.py", line 13, in <module> print(divide_and_multiply(parabolic_age)) File "parabolic_age_function.py", line 5, in divide_and_multiply raise ValueError ("parabolic age not allowed to be below 10, try again") ValueError: parabolic age not allowed to be below 10, try again"

I'm more than willing to throw it up on GitHub to get some help with this.

Thanks!

1 Answer

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 28,718 Points

I'd be happy to take a look at the code for you. You can share it from a workspace snapshot or GitHub link.