From c2f654c410b1791cdb654375b3355f3f562f1044 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Sun, 20 Oct 2024 03:26:04 +0900 Subject: [PATCH] Friendlier message --- src/deepl/cli.cr | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/deepl/cli.cr b/src/deepl/cli.cr index 2b33975..67946ff 100644 --- a/src/deepl/cli.cr +++ b/src/deepl/cli.cr @@ -170,11 +170,14 @@ module DeepL end def upload_document_to_translate - raise "Not implemented" + raise NotImplementedError.new("This action is not implemented yet") end 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) @@ -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!