add some error parsing macros
Merge pull request #181 from reaperhulk/error-handling

Add some error parsing macros