Class: ProconBypassMan::SendErrorCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/commands/send_error_command.rb

Class Method Summary collapse

Class Method Details

.execute(error:, stdout: true) ⇒ void

This method returns an undefined value.

Parameters:

  • error (String, Hash, Exception)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/procon_bypass_man/commands/send_error_command.rb', line 4

def self.execute(error: , stdout: true)
  body =
    case error
    when String, Hash
      error
    else
      error.full_message
    end

  ProconBypassMan.logger.error body
  ProconBypassMan.error_logger.error body
  puts body if stdout

  ProconBypassMan::ReportErrorJob.perform(error)
end