fix: config_parser uses error() and io.open directly #26

Closed
opened 2026-05-25 19:13:25 +02:00 by michael · 1 comment
Owner

Problems

  1. Header path and usage example are outdated:
    src/daw/lua/common/config_parser.lua -> daw/common/config_parser.lua
    daw.lua.common.config_parser -> daw.common.config_parser

  2. parse_file uses error() throughout instead of returning nil, err.
    Violates DAW error handling standard.
    Each error() is preceded by file:close() -- these calls can be
    removed once error handling is converted to nil, err with early return.

  3. io.open used directly -- see DAW/daw-lua-common#24 for policy decision.
    Fix depends on outcome of #24.

## Problems 1. Header path and usage example are outdated: `src/daw/lua/common/config_parser.lua` -> `daw/common/config_parser.lua` `daw.lua.common.config_parser` -> `daw.common.config_parser` 2. `parse_file` uses `error()` throughout instead of returning nil, err. Violates DAW error handling standard. Each error() is preceded by file:close() -- these calls can be removed once error handling is converted to nil, err with early return. 3. `io.open` used directly -- see DAW/daw-lua-common#24 for policy decision. Fix depends on outcome of #24.
Author
Owner

io.open replaced with fs.handle.open_read/read_line (new). error() replaced with nil,err returned at the exact point of failure -- no throw, no pcall wrapper at the M boundary. Contract change: parse_file() no longer throws. test_config_parser.lua updated accordingly.

io.open replaced with fs.handle.open_read/read_line (new). error() replaced with nil,err returned at the exact point of failure -- no throw, no pcall wrapper at the M boundary. Contract change: parse_file() no longer throws. test_config_parser.lua updated accordingly.
michael 2026-07-19 17:55:23 +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-common#26
No description provided.