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



598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/aidp/harness/error_handler.rb', line 598

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