Re: enhanced error fields - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: enhanced error fields
Date
Msg-id CAEYLb_URnkfdS8WncwVz9OXiaRf89eKc9DivozUkqZm4jnR=+w@mail.gmail.com
Whole thread Raw
In response to Re: enhanced error fields  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 28 December 2012 20:40, Peter Eisentraut <peter_e@gmx.net> wrote:
> Sure, OSError has a filename attribute (which I'm sure is qualified by a
> directory name if necessary), SyntaxError has filename, lineno, etc.
>
> OSError.filename is essentially the equivalent of what is being proposed
> here.

I disagree. That isn't the same as what's being proposed here, because
that's something you're only going to get for those particular
exception classes, and I'm guessing that the fields only exist to
facilitate refactoring tools, IDEs and the like.

If BaseException, Exception or StandardError had a function_name
field, and it was idiomatic to change the behaviour of an exception
handler on the basis of the field's value, that would be equivalent.
Obviously that is not the case.

-- 
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: enhanced error fields
Next
From: Peter Eisentraut
Date:
Subject: Re: multiple CREATE FUNCTION AS items for PLs