Update examples to include try-catch logic.