Re: [Twisted-Python] Is this possible to catch this error? (returned by protocols/memcached.py)

2011-06-03 Thread exarkun
On 02:04 pm, b...@fsn.hu wrote: >Hi, > >On 06/03/11 15:57, exar...@twistedmatrix.com wrote: >> >>>As you can see, the connection is timed out, and >>>protocols/memcached.py >>>lost its connection. But how could I catch this around the "mc.get" >>>call? >>>I guess this error should raise an excepti

Re: [Twisted-Python] Is this possible to catch this error? (returned by protocols/memcached.py)

2011-06-03 Thread Attila Nagy
Hi, On 06/03/11 15:57, exar...@twistedmatrix.com wrote: > > Using a global protocol instance like this is error prone. >> return p >> >> def memc(): >> factory = MemCacheFactory() >> reactor.connectTCP('localhost', 11211, factory) >> reactor.callLater(1,query) > > What if the c

Re: [Twisted-Python] Is this possible to catch this error? (returned by protocols/memcached.py)

2011-06-03 Thread exarkun
On 12:54 pm, b...@fsn.hu wrote: >Hi, > >Here's a sample application, which gets a key from memcached: >from twisted.internet import reactor, protocol, defer >from twisted.application import internet, service >from twisted.protocols.memcache import MemCacheProtocol, DEFAULT_PORT > >mc = None > >c

[Twisted-Python] Is this possible to catch this error? (returned by protocols/memcached.py)

2011-06-03 Thread Attila Nagy
Hi, Here's a sample application, which gets a key from memcached: from twisted.internet import reactor, protocol, defer from twisted.application import internet, service from twisted.protocols.memcache import MemCacheProtocol, DEFAULT_PORT mc = None class MemCacheFactory(protocol.ReconnectingCli