title: Handling being online and offline
body: <p>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.</p>
  
  <p>What is the approach to handle this?</p>
  
  <p>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.</p>
  
  <p>Is this the right way or is there a better solution?</p>