Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71657

Re: Psycopg2 : error message.

References <1400235507987-5057062.post@n6.nabble.com>
Date 2014-05-16 21:39 +1000
Subject Re: Psycopg2 : error message.
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.10067.1400240371.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, May 16, 2014 at 8:18 PM, dandrigo <laurent.celati@gmail.com> wrote:
> Please read the 2 usefull files below :
>
> Dandrigo pg_test.py <http://python.6.x6.nabble.com/file/n5057062/pg_test.py>
>
> SS_dos.JPG <http://python.6.x6.nabble.com/file/n5057062/SS_dos.JPG>

These would be MUCH better included inline. Please, in future, copy
and paste the *text* of the error message - don't post a screenshot.

As to the actual problem: You're masking a potentially useful
exception behind a bare except that just prints a generic message *and
then continues*. This is a very bad idea. Don't do it. Take all that
out and just attempt the connection; then you'll get a useful error.
Same further down. Just don't.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Psycopg2 : error message. Chris Angelico <rosuav@gmail.com> - 2014-05-16 21:39 +1000

csiph-web