Class: Arkrb::ErrorParsing

Inherits:
Object
  • Object
show all
Defined in:
lib/arkrb/error_parsing.rb

Instance Method Summary collapse

Instance Method Details

#install_command(error_output) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/arkrb/error_parsing.rb', line 18

def install_command(error_output)
  missing_32_gcc = potential_errors[:missing_32_gcc]
  case error_output
    when /#{missing_32_gcc[:cause]}/im
      raise missing_32_gcc[:class], missing_32_gcc[:message]
    else
      raise_unknown_error('install', error_output)
  end
end

#sanitize!(command, error_output, command_opts = nil) ⇒ Object

Raises:

  • (ark_exe_not_found[:class])


4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/arkrb/error_parsing.rb', line 4

def sanitize!(command, error_output, command_opts = nil)
  ark_exe_not_found = potential_errors[:ark_exe_not_found]
  raise ark_exe_not_found[:class], ark_exe_not_found[:message] if error_output =~ /#{ark_exe_not_found[:cause]}/im
  server_offline = potential_errors[:server_offline]
  raise server_offline[:class], server_offline[:message] if error_output =~ /#{server_offline[:cause]}/im

  case command
    when :install
      install_command(error_output)
    else
      raise_unknown_error(command, error_output, command_opts)
  end
end