concept: warnings and errors - definition, reporting and display #24
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/design
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-contracts#24
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?
Goal
Define what a warning is, how it differs from an error, and how a
warning reaches the screen - the same way for every module and every
host. Today there is no contract for it, and the code has grown three
ways.
Background
"follow-up errors and warnings without a contract").
an error ends a function with
nil, daw_error/v1; a warning issomething that happened while the operation still worked.
daw_error_report/v1is on hold; a follow-up problem is a
daw_event/v1event(
cleanup_failedstyle); onlydaw_error/v1is an error object.daw_event/v1("Relation to daw_error/v1"): a warning-like occurrenceis a named
type/codethat says what happened, not a genericseverity label and not an embedded error object.
daw-project-standard, section 8):[WARN]means"unexpected, not blocking".
Current state (found in the code)
Producers:
result.warningsin DAW/daw-module-managerEntries are
{ kind, id?, error?, path? }, and are not uniform:install/available.lua:index_problem,module_broken- withidand
errorasdaw_error/v1activate.lua:leftover_removed,interrupted_install_restored-with
pathand noerroractivate.lua,install/init.lua:cleanup_failed-erroris adaw_error/v1install/init.lua(progress):progress_failed-erroris a plaintext, not a
daw_error/v1The same occurrence has two paths: a failed cleanup of the work
directory is a warning in
result.warningswhen the operation wasactivated, and an event
work_dir_cleanup_failedwhen it was not. Twocomments in the code mark this as INTERIM ("when warnings move to
events (see issue list)"; without a sink the event is lost).
Display:
adapters/ui/results.luain DAW/fragjan[WARN] <kind> <id>: <text>; the exit codeis raised to
warnkindis shown as the identifier, not as a translated text; awarning has no
resource_id, so it cannot be translatederroris shown as[WARN] leftover_removed: nil(reproduced);
pathis never shown[INFO] ...; an event has no level, so anevent can never be shown as a warning
DAW/fragjan#153) as a
[WARN]line, and also raises the exit codeQuestions to decide
examples), and what is an error? Where is the line for a failed
cleanup after a successful operation?
type/code, the host decides how to show it; (B)result.warningsas a list of
daw_error/v1objects only; (C) both, with a rule forwhich one is used when.
in the contract), the host (a configuration by
type), or thecontract (a list of warning types as data)? No fixed lists in code.
translated text (
resource_id), the data (path,id) shown, andthe exit code.
events)?
Scope
daw_event/v1, perhapsdaw_error/v1, README) and in the standards(producers), DAW/fragjan (display, the
nilline), DAW/daw-modul-berhtjan-cli(if it shows events)
Acceptance criteria
nildisplay and the untranslatedkindnamed in theimplementation issues
Related
DAW/daw-contracts#21 (
daw_error_report/v1on hold),DAW/daw-contracts#20 (event message), DAW/fragjan#153,
DAW/daw-module-manager#29