Skip to content

Commit

Permalink
Friendlier message
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Oct 19, 2024
1 parent 5ac3b5d commit 66452ea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/deepl/cli.cr
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ module DeepL

def check_document_translation_status
translator = DeepL::Translator.new
if option.document_id.nil? || option.document_key.nil?
raise "Document ID or key is not specified"
end
document_id = option.document_id.not_nil!
document_key = option.document_key.not_nil!
document_handle = DocumentHandle.new(document_id, document_key)
Expand All @@ -184,6 +187,12 @@ module DeepL

def download_translated_document
translator = DeepL::Translator.new
if option.document_id.nil? || option.document_key.nil?
raise "Document ID or key is not specified"
end
if option.output_file.nil?
raise "Output file is not specified"
end
document_id = option.document_id.not_nil!
document_key = option.document_key.not_nil!
output_file = option.output_file.not_nil!
Expand Down

0 comments on commit 66452ea

Please sign in to comment.