Hey, how about I actually add in my test controller class?
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Deserialize / YAML.pm
index b972830..bae0fc7 100644 (file)
@@ -19,12 +19,20 @@ 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!');
+            'I would have deserialized, but there was nothing in the body!')
+            if $c->debug;
     }
+    return 1;
 }
 
 1;