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 +4 -4
- data/lib/kailash/kailash.bundle +0 -0
- data/lib/kailash/kailash.so +0 -0
- data/lib/kailash.rb +36 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a21d0330811e22005051e5c1d93e0e522d7cfa3a48c782cf7b6269db015e6a9
|
|
4
|
+
data.tar.gz: 7ef19c635c7f5d531e0ef1883754ad2024fad1cdecd856fcae24525f6f37c23e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 275e28fde9caca4970882b31b5eb461b23d877fac725d1ae5a1e8c1d368f918b755aff3073ef30e66bd55e7f2e9ff32e1fb4442deb9467eca508fa3091611bd0
|
|
7
|
+
data.tar.gz: 5bf192b854faa962920744e3f4f1b86d82763b99a9f6f7827a810389911da336266fb4bbd4f90d622467f866a10b41f94e5c8070230284adb017e1562d86977e
|
data/lib/kailash/kailash.bundle
CHANGED
|
Binary file
|
data/lib/kailash/kailash.so
CHANGED
|
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
|