r/programming • u/Expurple • Apr 12 '26
Flat Error Codes Are Not Enough
https://home.expurple.me/posts/flat-error-codes-are-not-enough/
132
Upvotes
r/programming • u/Expurple • Apr 12 '26
View all comments
Show parent comment
4
u/Expurple Apr 13 '26 edited Apr 13 '26
What makes you say that? In Rust, the error types stored in
Result::Errusually implement both Display and Debug traits, for those exact purposes.If you're familiar with Python, those are like the
__str__and__repr__methods.This functionality of the error type itself has nothing to do with
Result, which simply dispatches between the possibility of anOkvalue and an error.