Class: Aidp::Harness::ErrorHandler::ErrorClassifier

Inherits:
Object
  • Object
show all
Defined in:
lib/aidp/harness/error_handler.rb

Instance Method Summary collapse

Instance Method Details

#classify_error(error, context = {}) ⇒ Object



618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/aidp/harness/error_handler.rb', line 618

def classify_error(error, context = {})
  error_type = classify_error_type(error)

  {
    error: error,
    error_type: error_type,
    provider: (context&.is_a?(Hash) && context[:provider]) || "unknown",
    model: (context&.is_a?(Hash) && context[:model]) || "unknown",
    timestamp: Time.now,
    context: context || {},
    message: error&.message || "Unknown error",
    backtrace: error&.backtrace&.first(5)
  }
end