Add statuscode test and some love to on-error callback
Merge pull request #1 from dannycobussen/master

Add statuscode test and some love to on-error callback