Re: Problem with error handling

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Eric Snow <esnow(at)verio(dot)net>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: Problem with error handling
Date: 2011-04-24 01:47:55
Message-ID: BANLkTik29KFA-ZGARTDJGeYbBCA_Mj5=Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Sat, Apr 23, 2011 at 2:56 AM, Eric Snow <esnow(at)verio(dot)net> wrote:

> I am guessing that the solution is one of the following:
>
> * PQresultErrorField should not have returned NULL

This is from the libpq, I guess we can do little about it, if not
keeping it in consideration.

> * "exc" should have been calculated another way (like an else after the
> "if (code != NULL)")

Definitely there should have been an else here: We check for the state
not null but then don't do anything as an alternative. I don't think
passing a NULL to psyco_set_error was ever intentional. Fixing in my
repos.

> Regardless of the solution, thanks for your time.

Thank you for yours!

-- Daniele

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2011-04-24 02:07:15 Re: Problem with error handling
Previous Message Eric Snow 2011-04-23 01:56:13 Problem with error handling