diff --git a/src/deepl.cr b/src/deepl.cr index 2c8b11b..de76367 100644 --- a/src/deepl.cr +++ b/src/deepl.cr @@ -30,7 +30,11 @@ module DeepL puts translated_text rescue ex - STDERR.puts "ERROR: #{ex.class} #{ex.message}" + if DeepLError.debug + STDERR.puts "[deepl-cli] ERROR: #{ex.class} #{ex.message}\n#{ex.backtrace.join("\n")}" + else + STDERR.puts "[deepl-cli] ERROR: #{ex.class} #{ex.message}" + end exit(1) end end diff --git a/src/deepl/parser.cr b/src/deepl/parser.cr index c2c38bb..64a3136 100644 --- a/src/deepl/parser.cr +++ b/src/deepl/parser.cr @@ -48,7 +48,7 @@ module DeepL show_help end invalid_option do |flag| - STDERR.puts "ERROR: #{flag} is not a valid option." + STDERR.puts "[deepl-cli] ERROR: #{flag} is not a valid option." STDERR.puts self exit(1) end