[Rt-commit] r5206 - rt/branches/3.4-RELEASE/lib/RT/Interface

ruz at bestpractical.com ruz at bestpractical.com
Thu May 11 16:49:02 EDT 2006


Author: ruz
Date: Thu May 11 16:48:53 2006
New Revision: 5206

Modified:
   rt/branches/3.4-RELEASE/lib/RT/Interface/Web.pm

Log:
* return values checking and more logging on errors

Modified: rt/branches/3.4-RELEASE/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.4-RELEASE/lib/RT/Interface/Web.pm	Thu May 11 16:48:53 2006
@@ -288,9 +288,18 @@
         Body                => $ARGS{'Content'},
     );
 
-    if ($ARGS{'Attachments'}) {
-        $MIMEObj->make_multipart;
-        $MIMEObj->add_part($_) foreach values %{$ARGS{'Attachments'}};
+    if ( $ARGS{'Attachments'} ) {
+        my $rv = $MIMEObj->make_multipart;
+        $RT::Logger->error("Couldn't make multipart message")
+            if !$rv || $rv !~ /^(?:DONE|ALREADY)$/;
+
+        foreach ( values %{$ARGS{'Attachments'}} ) {
+            unless ( $_ ) {
+                $RT::Logger->error("Couldn't add empty attachemnt");
+                next;
+            }
+            $MIMEObj->add_part($_);
+        }
     }
 
     my %create_args = (


More information about the Rt-commit mailing list