For distinguishing the errors from the process from the timeout, you have to manage the returns from wait, an example here:
確定! 回上一頁