Follow-up: daw_error/v1 cell_id/resource_id update #10

Closed
opened 2026-08-12 20:30:48 +02:00 by michael · 1 comment
Owner

Goal

Track follow-up work in daw-lua-net resulting from the daw_error/v1
contract update in DAW/daw-contracts.

Background

Same update as DAW/daw-lua-common#46: source
clarified, cell_id and resource_id added as optional fields.

Questions to resolve here

  • Does daw-lua-net construct daw_error/v1 objects directly anywhere
    (http_client.lua, ip_utils.lua), or does it only receive/propagate
    errors built by daw-lua-common? If the latter, this may need no code
    change, only confirmation.

Acceptance criteria

  • Confirmed whether any change is needed
  • If changed: implemented, tests updated

References

  • DAW/daw-contracts daw_error/v1
  • DAW/daw-lua-common#
## Goal Track follow-up work in daw-lua-net resulting from the daw_error/v1 contract update in DAW/daw-contracts. ## Background Same update as DAW/daw-lua-common#46: `source` clarified, `cell_id` and `resource_id` added as optional fields. ## Questions to resolve here - Does daw-lua-net construct daw_error/v1 objects directly anywhere (http_client.lua, ip_utils.lua), or does it only receive/propagate errors built by daw-lua-common? If the latter, this may need no code change, only confirmation. ## Acceptance criteria - [ ] Confirmed whether any change is needed - [ ] If changed: implemented, tests updated ## References - DAW/daw-contracts daw_error/v1 - DAW/daw-lua-common#<issue-number-from-above>
Author
Owner

Result

Answer to the open question: yes, daw-lua-net constructs daw_error/v1
objects itself. Every module (init.lua, ip_utils.lua, http_client.lua)
has a local fail() helper, including the bootstrap fallback. A code
change was needed and is done.

Changes

  • The plain-string bootstrap fallback is replaced by the reserved
    daw_error/v1 sentinel (daw-error-facility-unavailable) in all three
    files, aligned with DAW/daw-lua-common. README updated.
  • Every error construction site has its own resource_id: init.lua 3,
    ip_utils.lua 15, http_client.lua 12 = 30 canonical resources in
    i18n/en.json, with German translations in i18n/de.json (daw_i18n/v1).
  • http_client: request() now builds its daw_error/v1 where the failure
    is detected; get/post/put just return request(...).
  • init.lua: the submodule stub message is now the parametrized
    '{submodule} submodule not available'; the load error moves to
    data.detail.

Behaviour changes

  • Bootstrap fallback is now a daw_error/v1 object, not a string.
  • http connection failures: message is 'request failed', the raw
    LuaSocket text is in data.detail.
  • Stub messages changed as described above; data.dependency added for
    the http_client dependency stub.

Tests

65 tests pass on Lua 5.1 and 5.4 (test_http_client.lua and
test_init.lua updated for the new messages).

Not in scope, filed separately

  • http_client dependency stub returns the error as first value
  • Makefile install target points to a non-existent src/ directory

Related: DAW/daw-lua-common#46

## Result Answer to the open question: yes, daw-lua-net constructs daw_error/v1 objects itself. Every module (init.lua, ip_utils.lua, http_client.lua) has a local fail() helper, including the bootstrap fallback. A code change was needed and is done. ## Changes - The plain-string bootstrap fallback is replaced by the reserved daw_error/v1 sentinel (daw-error-facility-unavailable) in all three files, aligned with DAW/daw-lua-common. README updated. - Every error construction site has its own resource_id: init.lua 3, ip_utils.lua 15, http_client.lua 12 = 30 canonical resources in i18n/en.json, with German translations in i18n/de.json (daw_i18n/v1). - http_client: request() now builds its daw_error/v1 where the failure is detected; get/post/put just return request(...). - init.lua: the submodule stub message is now the parametrized '{submodule} submodule not available'; the load error moves to data.detail. ## Behaviour changes - Bootstrap fallback is now a daw_error/v1 object, not a string. - http connection failures: message is 'request failed', the raw LuaSocket text is in data.detail. - Stub messages changed as described above; data.dependency added for the http_client dependency stub. ## Tests 65 tests pass on Lua 5.1 and 5.4 (test_http_client.lua and test_init.lua updated for the new messages). ## Not in scope, filed separately - http_client dependency stub returns the error as first value - Makefile install target points to a non-existent src/ directory Related: DAW/daw-lua-common#46
michael 2026-09-20 19:30:19 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-lua-net#10
No description provided.