From f96e7187e896058be95f7891aa03769aeac1ec70 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Wed, 28 Feb 2024 19:59:31 +0800 Subject: [PATCH] fix undefined plain_output? --- lib/synvert/command.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/synvert/command.rb b/lib/synvert/command.rb index fa9e8b8..d0f760b 100644 --- a/lib/synvert/command.rb +++ b/lib/synvert/command.rb @@ -179,10 +179,10 @@ def run_snippet(rewriter, format) if ENV['DEBUG'] puts e.backtrace.join("\n") end - if plain_output? - puts "Error: #{e.message}" - else + if format == 'json' puts({ error: e.message }.to_json) + else + puts "Error: #{e.message}" end raise end