<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _state_connecting(self):
 """ A connection is being started. A succesful attempt results in the state C{'connected'} when the first response from Twitter has been received. Transitioning to the state C{'aborting'} will cause an immediate disconnect instead, by transitioning to C{'disconnecting'}. Errors will cause a transition to the C{'error'} state. """


        def responseReceived(protocol):
            self.makeConnection(protocol)
            if self._state == 'aborting':
                self._toState('disconnecting')
            else:
                self._toState('connected')

        def trapError(failure):
            self._toState('error', failure)

        def onEntry(entry):
            if self.delegate:
                try:
                    self.delegate(entry)
                except:
                    log.err()
            else:
                pass

        d = self.api(onEntry, self.args)
        d.addCallback(responseReceived)
        d.addErrback(trapError)