Added error verification
Converted indentation to spaces
Merge pull request #4 from seegno/exception-handler

Add error verification