Company
Date Published
Author
Aaron Harper
Word count
1076
Language
English
Hacker News points
41

Summary

This article discusses error handling in programming languages, comparing thrown errors with errors as values. It highlights that while Python traditionally uses thrown errors, returning errors as values can be more effective for handling and documenting errors. The author demonstrates how to handle errors as values in Python using different approaches such as tuples, the Result library, and unions. They conclude by explaining why they chose to use unions for error handling in their Python SDK.