Module: Kailash::Nexus

Defined in:
lib/kailash.rb

Defined Under Namespace

Classes: NexusHandlerError

Class Method Summary collapse

Class Method Details

._invoke_extract_handler(proc_obj, kwargs) ⇒ Object

Internal helper — invoked by the Rust binding via Kailash::Nexus._invoke_extract_handler(proc, kwargs) to dispatch a handler Proc with **kwargs splat semantics. Kwargs-declaring Procs (|headers:, body:|) require splat; magnus's funcall cannot emit a splat directly, so we centralise it here.

NexusHandlerError is translated to a sentinel Hash the Rust side unpacks into an HTTP response. Any other exception re-raises for the Rust error path.



97
98
99
100
101
# File 'lib/kailash.rb', line 97

def self._invoke_extract_handler(proc_obj, kwargs)
  proc_obj.call(**kwargs)
rescue NexusHandlerError => e
  { __nexus_err__: true, status: e.status, body: e.body }
end