3 ms·
> 2 - If you're aggregating so many error types that it's unwieldy, you're probably doing to much in one place. That has all sorts of down stream issues with te
by epage 7y ago
> 2 - If you're aggregating so many error types that it's unwieldy, you're probably doing to much in one place. That has all sorts of down stream issues with testability and what not. Hacking your error types to make it easier is probably not the best option.
I'd disagree. In a static-site-generator, I need to deal with
- file format errors
- syntax highlighting errors
- io errors
- Template language errors
- Adhoc errors I construct throughout the application
- Regex errors
- RSS errors
- jsonfeed errors
- sitemap errors
- git errors
Without even getting into any errors from the webserver that is being run. Yes, I could carefully construct an error enum for each subsection of the application and bubble those up ... but why? I'm not programmatically acting on these but sending them up to the user.
- monocasa 7y agoBy dumping all those together, you've lost context as to why or where these errors have come from. Just yolo displaying io errors is a terrible experience for your users.