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 - Python Tutorial
From the course: Building Tools with Python
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Exploring the sample tool3m 6s
-
(Locked)
Using shell commands from Python3m 43s
-
(Locked)
Challenge: Use shell commands in Python52s
-
(Locked)
Solution: Use shell commands in Python2m 4s
-
(Locked)
Accepting arguments6m 31s
-
(Locked)
Challenge: Practice with arguments55s
-
(Locked)
Solution: Practice with arguments1m 28s
-
(Locked)
Providing error messages and logging5m 29s
-
(Locked)
Ensuring functionality2m 53s
-
(Locked)
Challenge: Check for necessary conditions51s
-
(Locked)
Solution: Check for necessary conditions1m 33s
-
(Locked)
Adding a user interface4m 28s
-
(Locked)
Packaging and distributing a tool4m 14s
-
(Locked)
Supporting the tool2m 2s
-
-