resolves #270: catch shell errors

@kevgo