r49@latte: adam | 2006-12-03 12:30:40 -0800
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Deserialize / YAML.pm
index b972830..84630f4 100644 (file)
@@ -19,12 +19,19 @@ sub execute {
 
     my $body = $c->request->body;
     if ($body) {
-        my $rdata = LoadFile( $c->request->body );
+        my $rdata;
+        eval {
+            $rdata = LoadFile( $c->request->body );
+        };
+        if ($@) {
+            return $@;
+        }
         $c->request->data($rdata);
     } else {
         $c->log->debug(
             'I would have deserialized, but there was nothing in the body!');
     }
+    return 1;
 }
 
 1;