Exception: Leakferret::BinaryInvocationError

Inherits:
Error
  • Object
show all
Defined in:
lib/leakferret/error.rb

Overview

Raised when the binary runs but exits with an unexpected status (anything other than 0 for a clean run or 1 for findings present).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, exit_status:, stderr:) ⇒ BinaryInvocationError

Returns a new instance of BinaryInvocationError.

Parameters:

  • message (String)

    human-readable error message

  • exit_status (Integer)

    the binary's exit status

  • stderr (String)

    captured standard error



23
24
25
26
27
# File 'lib/leakferret/error.rb', line 23

def initialize(message, exit_status:, stderr:)
  super(message)
  @exit_status = exit_status
  @stderr = stderr
end

Instance Attribute Details

#exit_statusInteger (readonly)

Returns the binary's process exit status.

Returns:

  • (Integer)

    the binary's process exit status



15
16
17
# File 'lib/leakferret/error.rb', line 15

def exit_status
  @exit_status
end

#stderrString (readonly)

Returns captured standard error from the failed invocation.

Returns:

  • (String)

    captured standard error from the failed invocation



18
19
20
# File 'lib/leakferret/error.rb', line 18

def stderr
  @stderr
end