Class: Aidp::Harness::UI::ErrorFormatter
- Inherits:
-
Object
- Object
- Aidp::Harness::UI::ErrorFormatter
- Defined in:
- lib/aidp/harness/ui/error_handler.rb
Overview
Formats error messages for display
Instance Method Summary collapse
- #format_component_error(error, component_name = nil) ⇒ Object
- #format_display_error(error, component_name = nil) ⇒ Object
- #format_generic_error(error) ⇒ Object
- #format_interaction_error(error, interaction_type = nil) ⇒ Object
- #format_recovery_suggestion(error_type) ⇒ Object
- #format_validation_error(error, field_name = nil) ⇒ Object
Instance Method Details
#format_component_error(error, component_name = nil) ⇒ Object
110 111 112 113 114 |
# File 'lib/aidp/harness/ui/error_handler.rb', line 110 def format_component_error(error, component_name = nil) = "Component error" component_suffix = component_name ? " in #{component_name}" : "" "#{}#{component_suffix}: #{error.}" end |
#format_display_error(error, component_name = nil) ⇒ Object
98 99 100 101 102 |
# File 'lib/aidp/harness/ui/error_handler.rb', line 98 def format_display_error(error, component_name = nil) = "Display error" component_suffix = component_name ? " in #{component_name}" : "" "#{}#{component_suffix}: #{error.}" end |
#format_generic_error(error) ⇒ Object
116 117 118 |
# File 'lib/aidp/harness/ui/error_handler.rb', line 116 def format_generic_error(error) "An unexpected error occurred: #{error.}" end |
#format_interaction_error(error, interaction_type = nil) ⇒ Object
104 105 106 107 108 |
# File 'lib/aidp/harness/ui/error_handler.rb', line 104 def format_interaction_error(error, interaction_type = nil) = "Interaction error" type_suffix = interaction_type ? " during #{interaction_type}" : "" "#{}#{type_suffix}: #{error.}" end |
#format_recovery_suggestion(error_type) ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/aidp/harness/ui/error_handler.rb', line 120 def format_recovery_suggestion(error_type) case error_type when :validation "Please check your input and try again." when :display "The display may not render correctly. Please try again." when :interaction "Please try the interaction again." when :component "The component may not function properly. Please restart the application." else "Please try again or restart the application if the problem persists." end end |
#format_validation_error(error, field_name = nil) ⇒ Object
92 93 94 95 96 |
# File 'lib/aidp/harness/ui/error_handler.rb', line 92 def format_validation_error(error, field_name = nil) = "Validation failed" field_suffix = field_name ? " for #{field_name}" : "" "#{}#{field_suffix}: #{error.}" end |