fix test case: handle exception