kailash 3.17.1-aarch64-linux → 3.19.0-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e957a9a5548605d90635ee99f397524a66885aeb676079bea94ca7c0cbfa663
4
- data.tar.gz: 863c264088f5fd2587d4b59e7da253b47a99d3af394db4d15193b53379c0a9bf
3
+ metadata.gz: 5a21d0330811e22005051e5c1d93e0e522d7cfa3a48c782cf7b6269db015e6a9
4
+ data.tar.gz: 7ef19c635c7f5d531e0ef1883754ad2024fad1cdecd856fcae24525f6f37c23e
5
5
  SHA512:
6
- metadata.gz: bf201d9a8fa549155ba32052ad2ad626ee10e7cb8d6c4a39826e15b4beae2551c782d2e730ff9e9677dd7340d56b621320f22e271dc0c990ec748068ba9ea491
7
- data.tar.gz: 5e1100c41087bc91a91facd69e2c3b7bcc65acf2bc338403879d7942dbc5d7f03816c4efdda2118d3352225b697854e70c6f0924940ba59218ee583f3bec5e7f
6
+ metadata.gz: 275e28fde9caca4970882b31b5eb461b23d877fac725d1ae5a1e8c1d368f918b755aff3073ef30e66bd55e7f2e9ff32e1fb4442deb9467eca508fa3091611bd0
7
+ data.tar.gz: 5bf192b854faa962920744e3f4f1b86d82763b99a9f6f7827a810389911da336266fb4bbd4f90d622467f866a10b41f94e5c8070230284adb017e1562d86977e
Binary file
Binary file
data/lib/kailash.rb CHANGED
@@ -8,3 +8,39 @@ rescue LoadError
8
8
  # Fall back to searching the load path (for platform gems)
9
9
  require "kailash/kailash"
10
10
  end
11
+
12
+ module Kailash
13
+ module Nexus
14
+ # Typed exception a `handler_extract` callable raises to emit a
15
+ # non-default HTTP response with a structured body (#404 S5b).
16
+ #
17
+ # The Rust-side extractor dispatch rescues this exception and maps
18
+ # its `status` + `body` to the outgoing HTTP response. Any other
19
+ # exception falls through to the legacy 400 "Ruby handler raised"
20
+ # path for backward compatibility with S5a.
21
+ class NexusHandlerError
22
+ attr_reader :status, :body
23
+
24
+ def initialize(message = nil, status: 500, body: nil)
25
+ super(message || "Kailash::Nexus::NexusHandlerError(status=#{status})")
26
+ @status = Integer(status)
27
+ @body = body
28
+ end
29
+ end
30
+
31
+ # Internal helper — invoked by the Rust binding via
32
+ # `Kailash::Nexus._invoke_extract_handler(proc, kwargs)` to dispatch
33
+ # a handler Proc with `**kwargs` splat semantics. Kwargs-declaring
34
+ # Procs (`|headers:, body:|`) require splat; magnus's `funcall`
35
+ # cannot emit a splat directly, so we centralise it here.
36
+ #
37
+ # `NexusHandlerError` is translated to a sentinel Hash the Rust side
38
+ # unpacks into an HTTP response. Any other exception re-raises for
39
+ # the Rust error path.
40
+ def self._invoke_extract_handler(proc_obj, kwargs)
41
+ proc_obj.call(**kwargs)
42
+ rescue NexusHandlerError => e
43
+ { __nexus_err__: true, status: e.status, body: e.body }
44
+ end
45
+ end
46
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kailash
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.17.1
4
+ version: 3.19.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Kailash Authors