fix(main): unprotected require calls for core dependencies #37

Closed
opened 2026-05-25 11:51:43 +02:00 by michael · 1 comment
Owner

Problem

main.lua calls require() directly for core dependencies without pcall:

local dawsys   = require("daw.common.sys")
local core_cfg = require("core.config")
local ui       = require("adapters.ui")

A missing submodule or syntax error produces a raw Lua stack trace instead
of a controlled error message. This violates the DAW coding standard
("no silent failures").

Expected behavior

Each require should be wrapped in pcall with a clear [ERROR] message and
exit 10 on failure.

Acceptance criteria

  • All three require calls protected with pcall
  • Error message names the missing/broken module
  • Exit code is 10
## Problem `main.lua` calls `require()` directly for core dependencies without `pcall`: ```lua local dawsys = require("daw.common.sys") local core_cfg = require("core.config") local ui = require("adapters.ui") ``` A missing submodule or syntax error produces a raw Lua stack trace instead of a controlled error message. This violates the DAW coding standard ("no silent failures"). ## Expected behavior Each require should be wrapped in pcall with a clear `[ERROR]` message and exit 10 on failure. ## Acceptance criteria - [ ] All three require calls protected with pcall - [ ] Error message names the missing/broken module - [ ] Exit code is 10
Author
Owner

Scope expanded: unprotected require() calls exist in adapters/ui/init.lua too (dispatch and build_usage). Rule from DAW/fragjan#40 must cover all .lua files, not only main.lua.

Scope expanded: unprotected require() calls exist in adapters/ui/init.lua too (dispatch and build_usage). Rule from DAW/fragjan#40 must cover all .lua files, not only main.lua.
michael added this to the Basic Version milestone 2026-05-30 16:05:10 +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/fragjan#37
No description provided.