[ARVADOS] updated: 4a70edc75187b6b36ea7c7dfde5e3e1f523d8213

git at public.curoverse.com git at public.curoverse.com
Fri Jun 20 16:12:48 EDT 2014


Summary of changes:
 sdk/cli/bin/arv | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

       via  4a70edc75187b6b36ea7c7dfde5e3e1f523d8213 (commit)
      from  eaeee8fe0ef4f7fe5b5a3a1124be1275d0b0502e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 4a70edc75187b6b36ea7c7dfde5e3e1f523d8213
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Jun 20 16:12:44 2014 -0400

    2986: Report parsing errors and print out contents instead of just blowing up.

diff --git a/sdk/cli/bin/arv b/sdk/cli/bin/arv
index 355a947..0ad4a49 100755
--- a/sdk/cli/bin/arv
+++ b/sdk/cli/bin/arv
@@ -220,14 +220,24 @@ def arv_edit client, arvados, global_opts, remaining_opts
     newcontent = tmp.read()
 
     newobj = {}
-    case global_opts[:format]
-    when 'json'
-      newobj = Oj.load(newcontent)
-    when 'yaml'
-      newobj = YAML.load(newcontent)
+    begin
+      case global_opts[:format]
+      when 'json'
+        newobj = Oj.load(newcontent)
+      when 'yaml'
+        newobj = YAML.load(newcontent)
+      end
+    rescue Exception => e
+      puts "Parse error! " + e.to_s
+      n = 1
+      newcontent.each_line do |line|
+        puts "#{n.to_s.rjust 4}  #{line}"
+        n += 1
+      end
+      exit 1
     end
-    tmp.close
-    tmp.unlink
+
+    tmp.close(true)
 
     if newobj != results
       api_method = 'arvados.' + rsc + '.update'

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list