Handle errors.

In case of error, log a warning and suppress standard output.
Merge pull request #7 from daniel-star/handle-errors

Handle errors.