[refactor]error hundling