In this post I would like to make a step by step guide specifying the pros and cons of every possible solution in order to illustrate why is better to throw an Exception than to return an error code. Also, we’ll see how SOLID principles can be applied in ...