From: Bill Erickson Date: Fri, 27 Jul 2012 15:02:27 +0000 (-0400) Subject: EDI web translator stacktrace capture X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3237f3c1cf32b82a0efb8e3165fc1d63e444c2a6;p=evergreen%2Fequinox.git 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 --- 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