add try catch, emit error

之前的错误提示不明确。@fengmk2