[Rt-commit] [svn] r933 - rt/branches/rt-3.3/lib/RT

leira at pallas.eruditorum.org leira at pallas.eruditorum.org
Wed May 19 02:34:22 EDT 2004


Author: leira
Date: Wed May 19 02:34:22 2004
New Revision: 933

Modified:
   rt/branches/rt-3.3/lib/RT/Link_Overlay.pm
   rt/branches/rt-3.3/lib/RT/Record.pm
Log:
Actually pass along link error messages.  Resolves bps #2210.


Modified: rt/branches/rt-3.3/lib/RT/Link_Overlay.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Link_Overlay.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Link_Overlay.pm	Wed May 19 02:34:22 2004
@@ -81,24 +81,31 @@
     my $base = RT::URI->new( $self->CurrentUser );
     $base->FromURI( $args{'Base'} );
 
-    unless ( $base->Scheme ) {
-        $RT::Logger->warning( "$self couldn't resolve base:'"
-                              . $args{'Base'} . " - "
-                              . $base->Scheme
-                              . "' into a URI\n" );
-
-        return (undef);
+    unless ( $base->Resolver && $base->Scheme ) {
+	my $msg = $self->loc("Couldn't resolve base '[_1]' into a URI.", 
+			     $args{'Base'});
+        $RT::Logger->warning( "$self $msg\n" );
+
+	if (wantarray) {
+	    return(undef, $msg);
+	} else {
+	    return (undef);
+	}
     }
 
     my $target = RT::URI->new( $self->CurrentUser );
     $target->FromURI( $args{'Target'} );
 
     unless ( $target->Resolver ) {
-        $RT::Logger->warning( "$self couldn't resolve target:'"
-                              . $args{'Target'} . " - "
-                              . "' into a URI\n" );
-
-        return (undef);
+	my $msg = $self->loc("Couldn't resolve target '[_1]' into a URI.", 
+			     $args{'Target'});
+        $RT::Logger->warning( "$self $msg\n" );
+
+	if (wantarray) {
+	    return(undef, $msg);
+	} else {
+	    return (undef);
+	}
     }
 
     my $base_id   = 0;

Modified: rt/branches/rt-3.3/lib/RT/Record.pm
==============================================================================
--- rt/branches/rt-3.3/lib/RT/Record.pm	(original)
+++ rt/branches/rt-3.3/lib/RT/Record.pm	Wed May 19 02:34:22 2004
@@ -1118,7 +1118,7 @@
 
     unless ($linkid) {
         $RT::Logger->error("Link could not be created: ".$linkmsg);
-        return ( 0, $self->loc("Link could not be created") );
+        return ( 0, $self->loc("Link could not be created. [_1]", $linkmsg) );
     }
 
     my $TransString =


More information about the Rt-commit mailing list