Exception: Pdfsink::CommandError

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

Overview

Raised when the pdfsink-rs binary exits non-zero.

Carries the failing command, exit status, and captured stderr.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, command:, status:, stderr:) ⇒ CommandError

Returns a new instance of CommandError.



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

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

Instance Attribute Details

#commandArray<String> (readonly)

Returns the argv that was executed.

Returns:

  • (Array<String>)

    the argv that was executed



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

def command
  @command
end

#statusInteger? (readonly)

Returns the process exit status.

Returns:

  • (Integer, nil)

    the process exit status



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

def status
  @status
end

#stderrString (readonly)

Returns captured standard error.

Returns:

  • (String)

    captured standard error



21
22
23
# File 'lib/pdfsink/error.rb', line 21

def stderr
  @stderr
end