resolve #270: catch shell errors

@kevgo