Exception: Corosync::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/corosync/exceptions.rb

Overview

Base class that all Corosync exceptions descend from.

Corosync exception classes are programitcally generated from the ‘:cs_error_t` enum in `ffi/common.rb`. See that file for a comprehensive list of exception classes. The `:err_try_again` value will map to `Corosync::TryAgainError`. All exception classes follow the same pattern.

Constant Summary collapse

Map =
{}

Instance Attribute Summary collapse

Instance Attribute Details

#depthFixnum

The number of Corosync.cs_send methods the exception has passed through. This is important so that we don’t rescue nested exceptions. For example, we call cs_send(:cpg_dispatch) which calls a callback which calls cs_send(:cpg_mcast_joined). If the cpg_mcast_joined were to raise an exception, and we had a rescue around the cpg_dispatch, we wouldn’t know whether the exception came from cpg_mcast_joined or cpg_dispatch. However in this case the depth would be 2, and so we would know not to rescue it.

Returns:

  • (Fixnum)

    Number of cs_send methods the exception has passed through



11
12
13
# File 'lib/corosync/exceptions.rb', line 11

def depth
  @depth ||= 0
end