3 ms·
I have noticed I enjoy instead of throwing errors, use a generic Event type to determine if that action was ok or not. Like in Elixir (but in TypeScript). Makes
by tekkk 5y ago
I have noticed I enjoy instead of throwing errors, use a generic Event type to determine if that action was ok or not. Like in Elixir (but in TypeScript). Makes for easy logging too as you have to write an error message for each potential error the app might throw versus letting things crash and then figuring out what happened.
I guess though you can write explicit thrown error messages too. It's just throwing and catching seems more annoying and indirectional compared to the events.