Error helpers: fall back to sentinel when error.new() returns nothing #14
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-net#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The local error helper in
daw-lua-netdoes not fully guarantee adaw_error/v1-shaped return value:
If
pcallsucceeds butdaw_error.new()returns neitherobjnore, the helper returnsnil, and the caller ends up withreturn nil, nil-- silently violating the "always return adaw_error/v1 on failure" rule the sentinel path exists to protect.
The same shape existed in 26 files of daw-lua-common and is fixed
there (DAW/daw-lua-common#53). It is not reachable with the current
daw.common.error.new(); this is defensive hardening against a broken
or replaced error facility.
Scope
fail_missing()ininit.lua(returnsnil, err),fail()inip_utils.luaandfail()inhttp_client.lua.new()and one that returns nothing fall through tothe same sentinel;
data.detailnames the no-result case.i18n/en.json(text unchanged) and recompute theirsource_hashin
i18n/de.json.daw.common.errorwith anew()returningnil, as in daw-lua-common.Acceptance criteria
Related
DAW/daw-lua-common#53