resolve #270: catch shell errors