posted 16 years ago
I'm working on a personal project that is starting to get some size, 344kb as *.jar, split on 49 class files.
I might be releasing the program officially when it's done, so I want the program to log all errors so that the users can send me their log and help me fix any problems.
I've put in an error handling class that will print information of any exception recieved to the log file, plus show a dialog to the user about it.
It works fine catching any errors occuring when starting the program and loading files, where I have already put try/catch.
But I don't know what to do with the rest of the program, if I am to log all errors ever occuring. I'm not looking for methods to handle the errors, just to send the errors to the error handling class so that it can write them to file.
Since the program has several thousand lines already, I hope there is some way that doesn't require me to insert extra methods\lines "everywhere"...
Is there any way to just tell the program "if any exception occurs anywhere, call method"?
Would it be a good idea to make all methods throw exception?
Any ideas?