Fixes #383
Merge pull request #390 from angathorion/catch-io-exception

Fixes #383