Adding try catch exception to catch transactional error.