From 3237f3c1cf32b82a0efb8e3165fc1d63e444c2a6 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 27 Jul 2012 11:02:27 -0400 Subject: [PATCH] EDI web translator stacktrace capture When the ruby libs fail parsing the JSON (jedi) message, send the ruby stacktrace to a file for later investigation. Signed-off-by: Bill Erickson --- Open-ILS/src/edi_translator/edi_webrick.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/edi_translator/edi_webrick.rb b/Open-ILS/src/edi_translator/edi_webrick.rb index 4907dd0149..798447f495 100755 --- a/Open-ILS/src/edi_translator/edi_webrick.rb +++ b/Open-ILS/src/edi_translator/edi_webrick.rb @@ -100,8 +100,13 @@ servlet.add_handler("edi2json" ) { |a_string| } servlet.add_handler("json2edi" ) { |a_string| File.open('/tmp/ruby_json2edi.tmp', 'w') {|f| f.write(a_string) } # debugging, so we can compare what we rec'd w/ the orig. file - @map = OpenILS::Mapper.from_json(a_string) - @map.to_s + begin + @map = OpenILS::Mapper.from_json(a_string) + @map.to_s + rescue => exc + File.open('/tmp/edi_webrick-exception', 'w') {|f| f.write(exc.backtrace.inspect) } + raise "#{exc.message}: #{exc.backtrace}" + end } servlet.add_introspection -- 2.11.0