fix: exists -- unprotected require for daw.common.fs #73

Closed
opened 2026-05-25 20:07:45 +02:00 by michael · 2 comments
Owner

Problem

require("daw.common.fs") at module level is unprotected -- no pcall.
A missing or broken daw.common.fs produces a raw Lua stack trace
instead of a controlled error message.

Fix

local fs_ok, fs = pcall(require, "daw.common.fs")
if not fs_ok then
error("[ERROR] exists: daw.common.fs not available: " .. tostring(fs))
end

See also

## Problem `require("daw.common.fs")` at module level is unprotected -- no pcall. A missing or broken daw.common.fs produces a raw Lua stack trace instead of a controlled error message. ## Fix local fs_ok, fs = pcall(require, "daw.common.fs") if not fs_ok then error("[ERROR] exists: daw.common.fs not available: " .. tostring(fs)) end ## See also - DAW/fragjan#40 (same pattern, broader rule)
Author
Owner

Same pattern in contains primitive (daw-modul-fragjan-check-contains). Fix must be applied there too.

Same pattern in contains primitive (daw-modul-fragjan-check-contains). Fix must be applied there too.
Author
Owner

Same pattern in markdown primitive (daw-modul-fragjan-check-markdown). Fix must be applied there too.

Same pattern in markdown primitive (daw-modul-fragjan-check-markdown). Fix must be applied there too.
michael added this to the Basic Version milestone 2026-05-30 16:04:44 +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#73
No description provided.