lib/synvert/cli.rb in synvert-1.4.2 vs lib/synvert/cli.rb in synvert-1.4.3
- old
+ new
@@ -257,10 +257,13 @@
warnings: rewriter.warnings.union(rewriter.sub_snippets.sum([], &:warnings))
}
puts output.to_json
end
rescue StandardError => e
+ if ENV['DEBUG']
+ puts e.backtrace.join("\n")
+ end
if plain_output?
puts "Error: #{e.message}"
else
puts({ error: e.message }.to_json)
end
@@ -270,9 +273,12 @@
# test a snippet
def test_snippet(rewriter)
results = rewriter.test
puts results.to_json
rescue StandardError => e
+ if ENV['DEBUG']
+ puts e.backtrace.join("\n")
+ end
puts({ error: e.message }.to_json)
raise
end
# execute snippet