added exception throw catch

at open file.