Exception: HttpMimic::CommandError

Inherits:
Error
  • Object
show all
Defined in:
lib/http_mimic/exceptions.rb

Overview

Raised when the curl command fails or returns a non-zero exit status

Direct Known Subclasses

ConnectionError, SSLError, TimeoutError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, exit_code: nil, stderr: nil, command: nil, response: nil) ⇒ CommandError

Returns a new instance of CommandError.



14
15
16
17
18
19
20
# File 'lib/http_mimic/exceptions.rb', line 14

def initialize(message, exit_code: nil, stderr: nil, command: nil, response: nil)
  super(message)
  @exit_code = exit_code
  @stderr = stderr
  @command = command
  @response = response
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



12
13
14
# File 'lib/http_mimic/exceptions.rb', line 12

def command
  @command
end

#exit_codeObject (readonly)

Returns the value of attribute exit_code.



12
13
14
# File 'lib/http_mimic/exceptions.rb', line 12

def exit_code
  @exit_code
end

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/http_mimic/exceptions.rb', line 12

def response
  @response
end

#stderrObject (readonly)

Returns the value of attribute stderr.



12
13
14
# File 'lib/http_mimic/exceptions.rb', line 12

def stderr
  @stderr
end