Exception: DeepL::Exceptions::TranslationMemoryJobError
- Defined in:
- lib/deepl/exceptions/translation_memory_job_error.rb
Overview
Any failure of DeepL::Client#import_translation_memory_from_filepath or
#export_translation_memory_to_filepath except a missing input file. The failure being
wrapped is the cause.
Instance Attribute Summary collapse
-
#job ⇒ DeepL::Resources::TranslationMemoryJob?
readonly
The last job status the helper fetched,
nilbefore the first status check. -
#job_id ⇒ String?
readonly
ID of the import or export job, set as soon as the job was created,
nilif the failure happened before.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message, job_id, job, error = nil) ⇒ TranslationMemoryJobError
constructor
erroris the failure being wrapped; the HTTP status and retryability of a DeepL error are copied from it.
Methods inherited from Error
Constructor Details
#initialize(message, job_id, job, error = nil) ⇒ TranslationMemoryJobError
error is the failure being wrapped; the HTTP status and retryability of a DeepL error
are copied from it.
23 24 25 26 27 28 29 |
# File 'lib/deepl/exceptions/translation_memory_job_error.rb', line 23 def initialize(, job_id, job, error = nil) deepl_error = error.is_a?(Error) ? error : nil super(, http_status_code: deepl_error&.http_status_code, should_retry: deepl_error&.should_retry? || false) @job_id = job_id @job = job end |
Instance Attribute Details
#job ⇒ DeepL::Resources::TranslationMemoryJob? (readonly)
Returns The last job status the helper
fetched, nil before the first status check.
19 20 21 |
# File 'lib/deepl/exceptions/translation_memory_job_error.rb', line 19 def job @job end |
#job_id ⇒ String? (readonly)
Returns ID of the import or export job, set as soon as the job was created,
nil if the failure happened before. Use it to query or resume the job.
15 16 17 |
# File 'lib/deepl/exceptions/translation_memory_job_error.rb', line 15 def job_id @job_id end |