Error handling example code.

Fix for #66
Merge pull request #102 from hemanth/patch-2

Error handling example code.