Can someone please help me with something that seems simple but I've never really got my head round. Exceptions! I know how to write an exception but countless code samples with variables
bar doesn't help me in the slightest to see how these are actually used in real life scenarios.
Is it where there is potential to stop the process of execution? I have to confess I never use them, I just don't know how to use them. I'm sure they are important though. I guess if something is going to break, I just let it break, it's going to throw an error to the screen anyway and stop the execution. Is the point of an exception to not have an error of such appear and catch the error, and pass a message to the view to output? Then this lends my next questions, how do I know what parts of my code are likely to break? Should I wrap everything in exceptions handles? How extensively should these be throughout my code?
Sorry for something that seems like it could be figured out easily, I've just never managed to properly understand their usage. I'd appreciate if someone could point me in the correct direction at least, some real examples of which code to wrap would also be much appreciated. Thanks