Handle error from child process properly