Exception: Systemd::JournalError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/systemd/journal_error.rb

Overview

This execption is raised whenever a sd_journal_* call returns an error.

Defined Under Namespace

Modules: LIBC

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ JournalError

Instantiate a new JournalError based on the specified return code. ‘message` will be filled in by calling `strerror()` with the provided return code.



12
13
14
15
# File 'lib/systemd/journal_error.rb', line 12

def initialize(code)
  @code = -code
  super(LIBC.strerror(@code))
end

Instance Attribute Details

#codeObject (readonly)

Returns the (positive) error number.



7
8
9
# File 'lib/systemd/journal_error.rb', line 7

def code
  @code
end