develooper Front page | perl.perl6.announce.rfc | Postings from September 2000

RFC 359 (v1) Improvement needed in error messages (both internal errors and die function).

From:
Perl6 RFC Librarian
Date:
September 30, 2000 23:43
Subject:
RFC 359 (v1) Improvement needed in error messages (both internal errors and die function).
Message ID:
20001001063637.11363.qmail@tmtowtdi.perl.org
This and other RFCs are available on the web at
  http://dev.perl.org/rfc/

=head1 TITLE

Improvement needed in error messages (both internal errors and die function).

=head1 VERSION

  Maintainer: S. A. Janet <stosh@eskimo.com>
  Date: 30 Sep 2000
  Mailing List: perl6-language-errors@perl.org
  Number: 359
  Version: 1
  Status: Developing

=head1 ABSTRACT

Error messages should contain the word `ERROR' in them.  Messages due
to internal errors should contain `INTERNAL ERROR'.

Error messages should also contain the program name, or if that is not
known, the word `perl'.

=head1 DESCRIPTION

Internal error messages should be improved. For example,

                % perl -le 'print "PRIME" if (1 x shift) !~ /^(11+)\1+$/' 373403020102920303
                Out of memory!

is a poor message. This is better: "perl: FATAL ERROR: out of memory".

=head1 IMPLEMENTATION

This should require very minor improvements to die and the addition of
a function e.g. setprogramname() to register the program name internally:

                % cat foo.pl
                setprogramname( $0 );
                die "filenames expected" if ( $#ARGV < 0 );
                ...
                $ perl foo.pl
                foo.pl: FATAL ERROR: filenames expected

=head1 REFERENCES

None.





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About