Better error handling
Merge pull request #2 from roman01la/master

Better error handling