Original Post
I am working on my first serious 2D platformer for PC with Directx11, and Microsoft Visual C++. I have some exception handling done but not all. I have nothing yet for fatal errors. For example when loading resources I don't check to see if the resource is there, so if the file is renamed, moved or deleted the program probably will crash. Now I decided to simply use my own system to handle this. I'll check to see if the file is there before it is loaded and if it isn't I'll call a function that shows a messagebox with the error code and explanation of what caused it and any button will shut down the program. Now is this ok? I don't see how I could recover the program with a necessary missing file. Unless I had a backup folder with all necessary resources and moved the missing file back to where it is missing? Why go through all of that if the player shouldn't be tampering with such files anyway correct?
Also a general question regarding exception handling. Let's say a integer needs to be between 1 and 10 for the program to function properly. Now if I am sure that the program is set up in a way to where this integer won't have a value outside of its boundaries is an exception check even neccessary? Is it possible for a freak thing to happen and the variable wind up having a wrong value for some reason outside of the program's control?
Also a general question regarding exception handling. Let's say a integer needs to be between 1 and 10 for the program to function properly. Now if I am sure that the program is set up in a way to where this integer won't have a value outside of its boundaries is an exception check even neccessary? Is it possible for a freak thing to happen and the variable wind up having a wrong value for some reason outside of the program's control?