Fix error cases caused by `errorCb` not existing.
Merge pull request #2 from borjasalguero/check_error

Fix error cases caused by `errorCb` not existing.