[Jifty-commit] r1983 - in jifty/trunk: lib/Jifty/Action/Record

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Sep 16 16:18:23 EDT 2006


Author: jesse
Date: Sat Sep 16 16:18:22 2006
New Revision: 1983

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Action/Record/Create.pm

Log:
 r27566 at pinglin:  jesse | 2006-09-16 21:17:38 +0100
 * Ongoing work to pass through Class::ReturnValue errors all the way from Jifty::DBI to the view layer


Modified: jifty/trunk/lib/Jifty/Action/Record/Create.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action/Record/Create.pm	(original)
+++ jifty/trunk/lib/Jifty/Action/Record/Create.pm	Sat Sep 16 16:18:22 2006
@@ -67,13 +67,16 @@
             $values{$_} = scalar <$fh>;
         }
     }
-
-    my ($id, $msg) = $record->create(%values);
-
+    my $id;
+    my $msg = $record->create(%values);
     # Handle errors?
+    if (ref($msg)) { # If it's a Class::ReturnValue
+        ($id,$msg) = $msg->as_array;
+    }
+
     unless ( $record->id ) {
+        $self->log->debug(_("Create of %1 failed: %2", ref($record), $msg));
         $self->result->error($msg || _("An error occurred.  Try again later"));
-        $self->log->error(_("Create of %1 failed: %2", ref($record), $msg));
         return;
     }
 


More information about the Jifty-commit mailing list