Exception: HazardousError
- Defined in:
- lib/openc3/top_level.rb
Overview
If a hazardous command is sent through the OpenC3::Api this error is raised. OpenC3::Script rescues the error and prompts the user to continue.
Instance Attribute Summary collapse
-
#cmd_name ⇒ Object
Returns the value of attribute cmd_name.
-
#cmd_params ⇒ Object
Returns the value of attribute cmd_params.
-
#formatted ⇒ Object
formatted command for use in resending original.
-
#hazardous_description ⇒ Object
Returns the value of attribute hazardous_description.
-
#target_name ⇒ Object
Returns the value of attribute target_name.
Instance Method Summary collapse
Instance Attribute Details
#cmd_name ⇒ Object
Returns the value of attribute cmd_name.
39 40 41 |
# File 'lib/openc3/top_level.rb', line 39 def cmd_name @cmd_name end |
#cmd_params ⇒ Object
Returns the value of attribute cmd_params.
40 41 42 |
# File 'lib/openc3/top_level.rb', line 40 def cmd_params @cmd_params end |
#formatted ⇒ Object
formatted command for use in resending original
42 43 44 |
# File 'lib/openc3/top_level.rb', line 42 def formatted @formatted end |
#hazardous_description ⇒ Object
Returns the value of attribute hazardous_description.
41 42 43 |
# File 'lib/openc3/top_level.rb', line 41 def hazardous_description @hazardous_description end |
#target_name ⇒ Object
Returns the value of attribute target_name.
38 39 40 |
# File 'lib/openc3/top_level.rb', line 38 def target_name @target_name end |
Instance Method Details
#to_s ⇒ Object
44 45 46 47 48 49 |
# File 'lib/openc3/top_level.rb', line 44 def to_s string = "#{target_name} #{cmd_name} with #{cmd_params} is Hazardous " string << "due to '#{hazardous_description}'" if hazardous_description # Pass along the original formatted command so it can be resent string << ".\n#{formatted}" end |