That's a matter of good taste, but there's nothing preventing you from throwing exceptions on every issue and requiring consumers to handle them
That's a matter of good taste, but there's nothing preventing you from throwing exceptions on every issue and requiring consumers to handle them
Imagine you have a caching library that handles DB fallback. A cache that should be there but goes missing is arguably an issue.
Should if throw an exception for that to let you know, or should it gracefully fallback so your service stays alive ? The middle ground is leaving a log and chugging along, your proposition throws that out of the window.