Skip to content

Commit

Permalink
Friendlier messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Mar 21, 2024
1 parent c6f3e33 commit dfa1b6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/deepl.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/deepl/parser.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfa1b6d

Please sign in to comment.