Update ex5_25.cpp

Doing many works in catch scope is not a good habit.