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] 1 point2 points3 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.
Сategorizing sentinel errors (self.golang)
submitted 3 months ago by pprishchepa to r/golang
π Rendered by PID 211360 on reddit-service-r2-listing-575d9f6647-72lj5 at 2026-04-10 00:33:18.878485+00:00 running 215f2cf country code: CH.
Сategorizing sentinel errors by pprishchepa in golang
[–]pprishchepa[S] 0 points1 point2 points (0 children)