Re: warning handling in Perl scripts

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: warning handling in Perl scripts
Дата
Msg-id 1340608357.13589.7.camel@vanquo.pezone.net
обсуждение исходный текст
Ответ на Re: warning handling in Perl scripts  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: warning handling in Perl scripts  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On sön, 2012-06-24 at 16:05 -0400, Robert Haas wrote:
> > diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
> > index ebc4825..7d66da9 100644
> > --- a/src/backend/catalog/genbki.pl
> > +++ b/src/backend/catalog/genbki.pl
> > @@ -19,6 +19,8 @@
> >  use strict;
> >  use warnings;
> >
> > +local $SIG{__WARN__} = sub { die $_[0] };
> > +
> >  my @input_files;
> >  our @include_path;
> >  my $output_path = '';
> >
> > would address that.
> >
> > Could that cause any other problems?  Should it be added to all Perl
> > scripts?
> 
> This seems like a band-aid.

I'd think of it as a safety net.

> How about if we instead add whatever error-handling the script is
> missing, so that it produces an appropriate, human-readable error
> message?

That could also be worthwhile, but I think given the audience of that
script and the complexity of the possible failures, it could be a very
large and aimless project.  But there should still be a catch-all for
uncaught failures.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Golub
Дата:
Сообщение: pg_tablespace.spclocation column removed in 9.2
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: pg_tablespace.spclocation column removed in 9.2