Migrate 2.0.0 errors to daw_error/v1 #9

Open
opened 2026-08-10 08:37:04 +02:00 by michael · 0 comments
Owner

Goal

Migrate daw-lua-net 2.0.0 to the structured daw_error/v1 return contract before public release.

Session rationale

The session decided to use the current private 2.0.0 transition to introduce structured errors now. daw-lua-net is one of only two repositories already on that breaking line, so it should be aligned with daw-lua-common before the wider module ecosystem adopts 2.x.

Scope

  • Replace returned error strings with valid immutable daw_error/v1 objects on all public failure paths.
  • Preserve existing successful API shapes such as normalized HTTP results; only the error representation changes unless a concrete incompatibility is required by the contract migration.
  • Assign stable machine-readable error code values and correct source identities.
  • Preserve complete nested causes when lower layers return daw_error/v1.
  • Keep errors serializable and free of Lua-only runtime references.
  • Update tests and any Lua binding helpers required for validation/construction.

Acceptance criteria

  • All public failures return nil, <valid daw_error/v1 object>.
  • No public error path requires parsing formatted [ERROR] strings.
  • Propagated lower-level errors are represented through cause rather than string concatenation.
  • Error data remains fully serializable.
  • Tests cover object-based failures and existing network behavior remains unchanged apart from the agreed error representation.
  • make test passes on the Lua versions currently supported by the repository.

Cross-repository context

This migration depends on the finalized daw_error/v1 contract in DAW/daw-contracts and must remain aligned with the parallel DAW/daw-lua-common migration.

## Goal Migrate `daw-lua-net` 2.0.0 to the structured `daw_error/v1` return contract before public release. ## Session rationale The session decided to use the current private 2.0.0 transition to introduce structured errors now. `daw-lua-net` is one of only two repositories already on that breaking line, so it should be aligned with `daw-lua-common` before the wider module ecosystem adopts 2.x. ## Scope - Replace returned error strings with valid immutable `daw_error/v1` objects on all public failure paths. - Preserve existing successful API shapes such as normalized HTTP results; only the error representation changes unless a concrete incompatibility is required by the contract migration. - Assign stable machine-readable error `code` values and correct `source` identities. - Preserve complete nested causes when lower layers return `daw_error/v1`. - Keep errors serializable and free of Lua-only runtime references. - Update tests and any Lua binding helpers required for validation/construction. ## Acceptance criteria - [ ] All public failures return `nil, <valid daw_error/v1 object>`. - [ ] No public error path requires parsing formatted `[ERROR]` strings. - [ ] Propagated lower-level errors are represented through `cause` rather than string concatenation. - [ ] Error data remains fully serializable. - [ ] Tests cover object-based failures and existing network behavior remains unchanged apart from the agreed error representation. - [ ] `make test` passes on the Lua versions currently supported by the repository. ## Cross-repository context This migration depends on the finalized `daw_error/v1` contract in `DAW/daw-contracts` and must remain aligned with the parallel `DAW/daw-lua-common` migration.
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#9
No description provided.