Class to catch and handle exceptions