catch and log exception before rethrow