3 ms·
Then would you be nesting a number of exceptions. Some maybe real 404 exceptions, but some would be zero records found. And I think the zero records found shou
by appleiigs 7y ago
Then would you be nesting a number of exceptions. Some maybe real 404 exceptions, but some would be zero records found. And I think the zero records found should be handled in the business logic (if statements, switch/case), not in the exceptions.
- joshuamorton 7y agoIf I expect exactly one result, zero results is exceptional. If I expect zero or more results, zero results should be handled by the business logic.
- barrkel 7y agoThe expectation of a single result should be encoded in the API, not the business logic. It's a very common expectation for e.g. identifiers found on http paths.