SL::DB::Manager: find_by_or_create bubbelt jetzt exceptions
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 4 Nov 2016 12:06:38 +0000 (13:06 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 4 Nov 2016 12:41:43 +0000 (13:41 +0100)
SL/DB/Helper/Manager.pm

index b4d66da..d456e76 100644 (file)
@@ -22,7 +22,10 @@ sub find_by_or_create {
   my $class = shift;
 
   my $found;
-  eval { $found = $class->find_by(@_); };
+  eval {
+    $found = $class->find_by(@_);
+    1;
+  } or die $@;
   return defined $found ? $found : $class->object_class->new;
 }