Re: proposal: PL/Pythonu - function ereport

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Catalin Iacob <iacobcatalin(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Craig Ringer <craig(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: PL/Pythonu - function ereport
Date: 2015-12-29 19:05:27
Message-ID: CAFj8pRAryCVOWmmKf9EOm7wWKPVCHUfGEDf5n35KhhE_+5DYmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2015-12-08 7:06 GMT+01:00 Catalin Iacob <iacobcatalin(at)gmail(dot)com>:

> On Thu, Dec 3, 2015 at 6:54 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> > Don't understand - if Fatal has same behave as Error, then why it cannot
> be
> > inherited from Error?
> >
> > What can be broken?
>
> Existing code that did "except plpy.Error as exc" will now also be
> called if plpy.Fatal is raised. That wasn't the case so this changes
> meaning of existing code, therefore it introduces an incompatibility.
>

I read some notes about Python naming convention

and we can use different names for new exception classes

* common ancestor - plpy.BaseError

* descendants - plpy.ExecError, plpy.SPIError, plpy.FatalError

It should to decrease compatibility issues to minimum. SPIError was used
mostly for error trapping (see doc).

Is it ok for you?

Regards

Pavel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2015-12-29 19:08:19 Re: dynloader.h missing in prebuilt package for Windows?
Previous Message Pavel Stehule 2015-12-29 18:15:41 Re: custom function for converting human readable sizes to bytes