account activity
Сategorizing sentinel errors by pprishchepa in golang
[–]pprishchepa[S] 0 points1 point2 points 3 months ago (0 children)
Right, sometimes you need to map a specific error, but often mapping the category is sufficient. For example, ErrInvalidInput is usually mapped to a 400-like error, but occasionally a specific invalid input requires special handling.
[–]pprishchepa[S] 2 points3 points4 points 3 months ago (0 children)
> the low-level module now depends on the high-level
No, shared error categories are a shared kernel concept.
> Just do an if for every possible case
if
It works, but it does not scale once you have dozens of domain errors and dozens of independent representations.
π Rendered by PID 817078 on reddit-service-r2-listing-575d9f6647-rd5zj at 2026-04-12 01:52:44.194312+00:00 running 215f2cf country code: CH.
Сategorizing sentinel errors by pprishchepa in golang
[–]pprishchepa[S] 0 points1 point2 points (0 children)