Add utility method to capture ClassLoading exceptions.