Add some logging to exceptions