cpp catch runtime error