error handler
updated on error callback
Merge pull request #22 from calvinmetcalf/ns

error handler