Added onError
Merge pull request #78 from wagenet/onError

Added onError