Change error event to attemptError

When it reaches maxAttempts it calls callback with the last error