[Rt-devel] Errors generate warnings
Jesse Vincent
jesse at bestpractical.com
Fri Jun 15 12:31:08 EDT 2007
About to apply this equivalent, slightly more Masonic patch. Thanks!
=== html/Elements/Error
==================================================================
--- html/Elements/Error (revision 58163)
+++ html/Elements/Error (local)
@@ -61,7 +61,7 @@
<%args>
$Code => undef
-$Details => undef
+$Details =>''
$Title => loc("RT Error")
$Why => loc("the calling component did not specify why")
</%args>
@@ -77,7 +77,7 @@
$RT::Logger->error($error);
-if ( $session{'SessionType'} eq 'REST' ) {
+if ( defined ($session{'SessionType'} && $session{'SessionType'} eq
'REST' ) {
$r->content_type('text/plain');
$m->out( "Error: " . $Why . "\n" );
$m->out( $Details . "\n" );
On Jun 15, 2007, at 12:23 PM, Nicholas Clark wrote:
> html/Element/Errors generates uninitialized value warnings if the
> parameter
> $Details is not passed in, and if the SessionType is undefined. The
> following
> patch quietens it.
>
> Nicholas Clark
>
> Index: html/Elements/Error
> ===================================================================
> RCS file: /export/cvsroot/rt-external/html/Elements/Error,v
> retrieving revision 1.1.1.1
> diff -p -u -r1.1.1.1 Error
> --- html/Elements/Error 21 May 2007 14:38:40 -0000 1.1.1.1
> +++ html/Elements/Error 15 Jun 2007 16:17:14 -0000
> @@ -49,7 +49,7 @@
> <div class="error">
> <%$Why%>
> <br />
> -<%$Details%>
> +<% defined $Details ? $Details : '' %>
> </div>
>
> <%cleanup>
> @@ -65,7 +65,8 @@ $Why => loc("the calling component did n
> </%args>
>
> <%INIT>
> -my $error = "WebRT: $Why ($Details)";
> +my $error = "WebRT: $Why ";
> +$error .= " ($Details)" if defined $Details;
>
> # TODO: Log::Dispatch isn't UTF-8 safe. Autrijus needs to talk to
> dave rolsky about getting this fixed
> if ($] >= 5.007001) {
> @@ -75,10 +76,10 @@ if ($] >= 5.007001) {
>
> $RT::Logger->error($error);
>
> -if ( $session{'SessionType'} eq 'REST' ) {
> +if ( defined $session{'SessionType'} && $session{'SessionType'} eq
> 'REST' ) {
> $r->content_type('text/plain');
> $m->out( "Error: " . $Why . "\n" );
> - $m->out( $Details . "\n" );
> + $m->out( $Details . "\n" ) if defined $Details;
> $m->abort();
> }
> </%INIT>
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/
> rt-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20070615/59fe11e9/PGP.pgp
More information about the Rt-devel
mailing list