-
v2.1.0 Stable
released this
2026-08-10 13:19:40 +02:00 | 20 commits to main since this releaseBreaking changes
- All public failures across
http_clientandip_utilsnow return
nil, <daw_error/v1 object>instead ofnil, <string>. The return
contract itself (result, nil | nil, err) is unchanged -- only what
erris. SeeMIGRATION-DAW-LUA-NET-2.1.mdfor the full code table
and cause-chain examples. init.lua's facade stub (missing submodule case) likewise now
returnsnil, daw_error/v1instead of a string.
Fixes
- Module registration (
_G.daw_registerguard) corrected from
type(_G.daw_register) == "function"to the simple truthy check
if _G.daw_register then ..., matching the lived pattern already
used acrossdaw-lua-common(accepted decision, see
DAW/daw-docs#18). ip_utils.ip_matches_cidr(): the exact-match path (no/in
cidr) previously skipped IPv4 validation entirely and crashed with
a raw Lua error on a non-stringcidr(e.g.nil). Bothipand
cidrare now validated the same way regardless of which path is
taken.ip_utils.is_ip_allowed()/get_client_ip(): a non-table
allowed_ips/trusted_proxies(e.g. a bare string) previously
reached#/ipairs()directly and could crash or silently
misbehave. Both now returnnil, daw_error/v1for a non-table,
non-nil value.http_client:opts.headerswas previously used directly without a
type check; a non-table value (e.g. a string) could crash inside
pairs()/header lookup. Now validated up front in bothrequest()
andget_raw().http_client.post/put: ajson.encode()failure was previously
flattened into plain text ("encode failed: " .. tostring(err)),
discarding the structureddaw_error/v1fromjson.encode(). It is
now preserved ascauseon the resultingencode_failederror,
consistent with howip_utilsalready chains errors.
Internal
http_client.lua: internalrequest()helper now returns a
machine-readable reason keyword alongside its plain-text error, so
the publicget/post/putfunctions can build precise
daw_error/v1codes (invalid_opts,encode_failed,
connection_failed) without parsing error text.ip_utils.lua: nine distinct error codes across
ip_matches_cidr/is_ip_allowed/get_client_ip; public-to-public
error propagation now usescauseembedding instead of string
concatenation.init.lua: facade rebuilt around thedaw_error/v1-aware
fail()/module_stub()pattern shared withdaw.common/init.lua.test/dev-module-map.lua: addeddaw.common.error,
daw.common.error.util,daw.common.uuid-- required by the new
error contract, previously missing from this repo's dev module map.- New
test/test_init.luacovering the root facade (submodule
aggregation, object identity, stub fallback on a missing submodule),
mirroringdaw-lua-common'stest_init.lua. - Test suite: 42 -> 64 tests.
Migration
Only code that inspects error text (string matching/parsing on
err) needs changes -- code that only checksif err thenis
unaffected.MIGRATION-DAW-LUA-NET-2.1.mdwalks through the full
error-code reference and cause-chain examples.Requires daw-lua-common >= 2.1.0 (for
daw.common.error).Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- All public failures across