It looks like we don't reraise failures when constructing Stores as DisconnectionErrors.
stub@aargh:~/lp/replication$ python
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from storm.locals import *
>>> db = create_database('postgres://localhost:6666/whatever')
>>> from storm.exceptions import DisconnectionError
>>> try:
... store = Store(db)
... except DisconnectionError:
... print 'storm exception'
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/store.py", line 73, in __init__
self._connection = database.connect(self._event)
File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/database.py", line 410, in connect
return self.connection_factory(self, event)
File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/database.py", line 185, in __init__
self._raw_connection = self._database.raw_connect()
File "/usr/local/lib/python2.7/dist-packages/storm-0.19-py2.7-linux-x86_64.egg/storm/databases/postgres.py", line 329, in raw_connect
raw_connection = psycopg2.connect(self._dsn)
File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 179, in connect
connection_factory=connection_factory, async=async)
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 6666?
It looks like we don't reraise failures when constructing Stores as DisconnectionEr rors.
stub@aargh: ~/lp/replicatio n$ python database( 'postgres: //localhost: 6666/whatever' ) lib/python2. 7/dist- packages/ storm-0. 19-py2. 7-linux- x86_64. egg/storm/ store.py" , line 73, in __init__ _connection = database. connect( self._event) lib/python2. 7/dist- packages/ storm-0. 19-py2. 7-linux- x86_64. egg/storm/ database. py", line 410, in connect _factory( self, event) lib/python2. 7/dist- packages/ storm-0. 19-py2. 7-linux- x86_64. egg/storm/ database. py", line 185, in __init__ _raw_connection = self._database. raw_connect( ) lib/python2. 7/dist- packages/ storm-0. 19-py2. 7-linux- x86_64. egg/storm/ databases/ postgres. py", line 329, in raw_connect connect( self._dsn) python2. 7/dist- packages/ psycopg2/ __init_ _.py", line 179, in connect factory= connection_ factory, async=async) OperationalErro r: could not connect to server: Connection refused
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from storm.locals import *
>>> db = create_
>>> from storm.exceptions import DisconnectionError
>>> try:
... store = Store(db)
... except DisconnectionError:
... print 'storm exception'
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/usr/local/
self.
File "/usr/local/
return self.connection
File "/usr/local/
self.
File "/usr/local/
raw_connection = psycopg2.
File "/usr/lib/
connection_
psycopg2.
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 6666?