-
v2.1.0 Stable
released this
2026-08-06 22:25:10 +02:00 | 0 commits to main since this releasedaw-lua-common v2.1.0
Highlights
daw-lua-common now returns a structured
daw_error/v1object from every
public function on failure, instead of a plain error string. This is the
biggest architectural change in this release: every module boundary now
follows the same error contract, the same "no uncaught Lua errors leave
a library module" rule, and the same internal-helper-returns-plain-text
/ public-API-builds-one-error-object pattern.See README.md and
daw-contracts: daw_error/v1
for the full contract.New
daw.common.error-- new public module, thedaw_error/v1
constructor (error.new(),error.is_error()) used by every other
module in this library.fs.copy_preserve(src, dst)-- new function shelling out to
cp -a, preserving symlinks, permissions, timestamps, and ownership.
fs.copy()/fs.copy_dir()remain content-only (read+rewrite, no
metadata preservation) and are now explicitly documented as such.
Closes #40.
Fixed
sys:run_rc(): stderr from the executed command was not actually
being captured, contrary to the documented contract ("stdout and
stderr are both captured"). The trailing2>&1redirect bound only
to the marker-printingprintf, not to the command itself, due to
normal shell parsing ofcmd; printf ... 2>&1. Fixed by wrapping the
whole sequence in a POSIX brace group.fs.write_file(): a failed write could go unnoticed.f:write()
can report success even when the underlying write later fails on
close()(stdio buffering) -- both are now checked.config_parser: section type (the part before the name in
[type "name"]) now follows the same[a-z0-9_-]naming convention
as the section name. Previously[Server "abc"]was silently
accepted despite the uppercase type.decimal.round()/decimal.div():decimals/target_scaleare
now validated as non-negative integers, not just "is a number" --
negative or fractional values previously reached the internal
power-of-ten helper with undefined behavior.
Changed
decimal.luaanddaw.common.errorare now directory modules
(decimal/,error/) split into focused submodules behind a stable
facade -- require paths are unchanged.- Every module's
fail()/err()helper now also guards against
daw.common.error.new()itself raising (not just againstrequire()
failing), consistent with "no module propagates an uncaught Lua
error."
Migration notes
If any consumer code inspects the
errreturn value directly (e.g.
err:match(...), string concatenation, pattern matching on error
text), that code will break --erris now a table
({ schema, id, source, code, message, cause?, data? }), not a string.
Useerr.codefor programmatic checks anderr.messagefor the
human-readable text, ordaw.common.error.is_error(err)to check the
shape.This release only touches
daw-lua-commonitself. Consumer projects
are migrated to the new contract individually and at their own pace;
daw-lua-commonv1.x behavior for callers not yet updated is
unaffected until they upgrade their submodule pin.Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download