Good post. 👍
Laravel (Eloquent) ships with a nice findOrFail() method for models which throws a ModelNotFoundException when query does not return results. This has been my go-to approach instead of null-checks. I try to communicate with exceptions as much as possible - especially when I'm building a library - helps with debugging both in production and in development.
I enjoy using your approach as well! It forces the client to react in case i cannot deliver what i'm asked to. It does a really good job of exposing problems immediately when they happen. I do know that this approach doesn't warrant the admiration of every peer, not sure why though :D Well, hopefully someone will educate me on this one day.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.