check the return value of error handling function
Merge pull request #1 from jsuchome/Code-11-SP3

check the return value of error handling function