More nicer error handling
Merge pull request #157 from noway421/patch-2

More nicer error handling