wrap latest analysis logic in an exception handler