From 727d081626deed74fad4b5b66dca3afc97cd79be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 5 Sep 2018 09:05:55 +0200 Subject: [PATCH] Fix error message in extract job [ci skip] --- app/workers/extract_fulltext_job.rb | 4 ++-- spec/workers/extract_fulltext_job_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/workers/extract_fulltext_job.rb b/app/workers/extract_fulltext_job.rb index aa0fd5759b..026fbe24aa 100644 --- a/app/workers/extract_fulltext_job.rb +++ b/app/workers/extract_fulltext_job.rb @@ -59,9 +59,9 @@ class ExtractFulltextJob < ApplicationJob @text = resolver.text end rescue => e - Rails.logger.error { + Rails.logger.error( "Failed to extract plaintext from file #{@attachment.id} (On domain #{Setting.host_name}): #{e}: #{e.message}" - } + ) end end diff --git a/spec/workers/extract_fulltext_job_spec.rb b/spec/workers/extract_fulltext_job_spec.rb index 110ffeea89..244fa618a9 100644 --- a/spec/workers/extract_fulltext_job_spec.rb +++ b/spec/workers/extract_fulltext_job_spec.rb @@ -87,14 +87,14 @@ describe ExtractFulltextJob, type: :job do end context 'with exception in extraction' do - let(:exception_message) { 'boom' } + let(:exception_message) { 'boom-internal-error' } let(:logger) { Rails.logger } before do allow_any_instance_of(Plaintext::Resolver).to receive(:text).and_raise(exception_message) # This line is actually part of the test. `expect` call needs to go so far up here, as we want to verify that a message gets logged. - expect(logger).to receive(:error).with(exception_message) + expect(logger).to receive(:error).with(/boom-internal-error/) allow(attachment).to receive(:readable?).and_return(true) attachment.reload