From the course: Building Tools with Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Providing error messages and logging

Providing error messages and logging - Python Tutorial

From the course: Building Tools with Python

Start my 1-month free trial

Providing error messages and logging

- [Presenter] In a tool with a focused scope of operation usually there isn't too much that can go wrong. But if something does we need to be able to communicate that to the user in terms they can understand or at least in terms that they can recognize and act on. As developers, we might be content with seeing the stack trace of an error, or whatever error message Python, or whatever language we're using, gives us. But these kinds of things can be confusing and even intimidating to end users who aren't developers. Or worse yet, if we don't surface any kind of error to the user and the tool just crashes or exits when it hits a problem, that's not a good user experience either. So, as tool builders we need to sand off those rough edges and make error messages helpful and actionable for the user. There's two general ways of going about this. Either by looking for a specific condition we know to be good or bad or by setting up a…

Contents