mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 11:37:58 +00:00
fix: Exception tracking for dialogflow bot service (#6593)
This commit is contained in:
@@ -7,7 +7,7 @@ class Integrations::BotProcessorService
|
||||
|
||||
process_content(message)
|
||||
rescue StandardError => e
|
||||
ChatwootExceptionTracker.new(e, account: agent_bot).capture_exception
|
||||
ChatwootExceptionTracker.new(e, account: hook).capture_exception
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -35,6 +35,15 @@ describe Integrations::Dialogflow::ProcessorService do
|
||||
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
|
||||
let(:dialogflow_response) do
|
||||
ActiveSupport::HashWithIndifferentAccess.new(
|
||||
|
||||
Reference in New Issue
Block a user