error handle using Exception