stop after receiving an error

returning -1 will cause the callback to be unregistered and we will not receive further notifications