I have an application which makes calls to an online database. If I lose the connection to the internet or the database is down my application will crash.
What is the approach to handle this?
My own approach would be to have a object which keeps calling the database all the time and if an exception is thrown, then an event is fired which all the other components register to and which then would disable some functions.
Is this the right way or is there a better solution?