Exception: HazardousError

Inherits:
StandardError
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#cmd_nameObject

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_paramsObject

Returns the value of attribute cmd_params.



40
41
42
# File 'lib/openc3/top_level.rb', line 40

def cmd_params
  @cmd_params
end

#formattedObject

formatted command for use in resending original



42
43
44
# File 'lib/openc3/top_level.rb', line 42

def formatted
  @formatted
end

#hazardous_descriptionObject

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_nameObject

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_sObject



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