bin/fs_to_db.pl
changeset 60 7ad91b3d5562
parent 55 8d9daa16ccad
child 70 dfc2f094a04f
--- a/bin/fs_to_db.pl	Sun Feb 08 22:36:04 2015 +0100
+++ b/bin/fs_to_db.pl	Sun Feb 08 23:59:59 2015 +0100
@@ -47,10 +47,13 @@
 my $storage = $storage_class->new(config => $config->{Storage});
 
 foreach my $arg (@ARGV) {
-    my $pjson = decode_json(slurp $arg);
+    eval {
+        my $pjson = decode_json(slurp $arg);
 
-    my($filename, $dirs, $suffix) = fileparse($arg, qr/\.[^.]*/);
+        my($filename, $dirs, $suffix) = fileparse($arg, qr/\.[^.]*/);
 
-    my $uuid = $filename;
-    $storage->_db_insert_processed_data($uuid, $pjson);
+        my $uuid = $filename;
+        $storage->_db_insert_processed_data($uuid, $pjson);
+    };
+    warn $@ if $@;
 }