fix: Exception tracking for dialogflow bot service (#6593)
This commit is contained in:
@@ -7,7 +7,7 @@ class Integrations::BotProcessorService
|
|||||||
|
|
||||||
process_content(message)
|
process_content(message)
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
ChatwootExceptionTracker.new(e, account: agent_bot).capture_exception
|
ChatwootExceptionTracker.new(e, account: hook).capture_exception
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -35,6 +35,15 @@ describe Integrations::Dialogflow::ProcessorService do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when dilogflow raises exception' do
|
||||||
|
it 'tracks hook into exception tracked' do
|
||||||
|
last_message = conversation.reload.messages.last.content
|
||||||
|
allow(dialogflow_service).to receive(:query_result).and_raise(StandardError)
|
||||||
|
processor.perform
|
||||||
|
expect(conversation.reload.messages.last.content).to eql(last_message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'when dialogflow returns fullfillment text to be empty' do
|
context 'when dialogflow returns fullfillment text to be empty' do
|
||||||
let(:dialogflow_response) do
|
let(:dialogflow_response) do
|
||||||
ActiveSupport::HashWithIndifferentAccess.new(
|
ActiveSupport::HashWithIndifferentAccess.new(
|
||||||
|
|||||||
Reference in New Issue
Block a user