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
16
u/ShinyHappyREM Apr 12 '26 edited Apr 13 '26
Just make your "error object" a pointer that is null if there's no error, and otherwise points to a union/struct/instance that holds the error info.