Neater exception handling code.