fix: log only on system api key failures (#13968)
Removes sentry flooding of unnecessary rubyllm logs of wrong API key. Logs only system api key error since it would be P0. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
11
lib/llm/exception_trackable.rb
Normal file
11
lib/llm/exception_trackable.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module Llm::ExceptionTrackable
|
||||
private
|
||||
|
||||
def capture_llm_exception(error, credential:)
|
||||
if credential && credential[:source] == :system
|
||||
ChatwootExceptionTracker.new(error, account: exception_tracking_account).capture_exception
|
||||
else
|
||||
Rails.logger.error("[LLM] account=#{exception_tracking_account&.id} #{error.class}: #{error.message}")
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user