Raxol.Core.ErrorExperience (Raxol v2.0.1)

View Source

Enhanced error experience system for Raxol applications.

Phase 4.3 enhancement that provides intelligent error handling with:

  • Contextual fix suggestions based on Phase 3 optimizations
  • Integration with Phase 4.2 development tools
  • Pattern learning for common error scenarios
  • Interactive error recovery workflows

Features

  • Smart error classification with performance context
  • Automatic fix suggestions using Phase 3 knowledge
  • Integration with mix raxol.analyze and mix raxol.debug
  • Error pattern learning and prevention
  • Interactive recovery console

Summary

Functions

Classify error and provide enhancement based on Phase 3 patterns.

Classify error type for reporting purposes.

Generate automatic error report for learning system.

Enhanced error handling with intelligent suggestions and recovery.

Interactive error recovery console.

Types

enhanced_error()

@type enhanced_error() :: %{
  original_error: term(),
  category: error_category(),
  severity: Raxol.Core.ErrorHandler.error_severity(),
  context: map(),
  suggestions: [fix_suggestion()],
  performance_impact: :none | :low | :medium | :high | :critical,
  related_optimizations: [String.t()],
  recovery_options: [atom()]
}

error_category()

@type error_category() ::
  :performance
  | :compilation
  | :runtime
  | :ui_rendering
  | :terminal_io
  | :component_lifecycle
  | :optimization
  | :integration

fix_suggestion()

@type fix_suggestion() :: %{
  type: :automatic | :guided | :manual | :documentation,
  description: String.t(),
  action: String.t() | nil,
  confidence: float(),
  related_tools: [atom()],
  phase3_context: map() | nil
}

Functions

classify_and_enhance(error, context)

Classify error and provide enhancement based on Phase 3 patterns.

classify_error_type(error)

Classify error type for reporting purposes.

generate_error_report(enhanced_error)

Generate automatic error report for learning system.

handle_enhanced_error(error, context \\ %{})

Enhanced error handling with intelligent suggestions and recovery.

start_recovery_console(enhanced_error)

Interactive error recovery console.