2min chapter

 Rustacean Station  cover image

Code Like a Pro in Rust with Brenden Matthews

Rustacean Station

CHAPTER

How to Handle Exceptions in Python

A result is like either you have a result or you have an error usually. In either case, whenever you're handling that, like 99.9% of the time, the right thing is to match and then just handle both cases. And if it's a case where like you call a function and it returns a result or an option, then you just handle it once. Now with with result, of course, you can use the question mark operator,. You could essentially use the call stack as like a way of sort of handling exceptions. Russ doesn't have exceptions in like the like Python or Ruby or C++ way, or like Java or anything. But you can you can basically emulate

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode