Added error code support
Merge pull request #1 from nadavshatz/master

Added error code support