← Back to issue list

fix: correctly print multi-line errors

View original Github issue

Metadata

Project
craft-cli
Number
#270
Type
pull request
State
merged
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

Merged fix for multi-line error printing. The change splits error strings to print each line individually, preventing leftover characters from previous progress messages. Approved by two reviewers, passed CI, and resolves #263.

Suggested action:

No scores available.

Issue body

The bug manifested in a situation like this: - A long progress() message is printed, say "AAAAAAAA"; - An error is emitter, and the result of str(error) is a multi-line string where the first line is shorter than the previously-emitted progress() message. Example: "BBBB\nCCCC"; - The newline in the error message is not correctly handled by the printer, meaning that after "BBBB" is written to the terminal the remainder of the line is not cleared. So the end result looks like: > BBBBAAAA > CCCC The "proper" fix for this would mean a big rework on the printer to properly support multi-line messages; for now, fix only the error case by "manually" splitting the error message and printing each line individually. Fixes #263 - [ ] Have you followed the guidelines for contributing? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `tox`?

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged fix for multi-line error printing. The change splits error strings to print each line individually, preventing leftover characters from previous progress messages. Approved by two reviewers, passed CI, and resolves #263.
qwen3.6-35b-a3b-mtp-q6 Merged fix for multi-line error printing bug where leftover progress text remained visible. Resolves #263 by manually splitting error messages and printing each line individually, avoiding a full printer rework.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#329 style: fix typo in error message craft-application merged Merged a single-line change correcting a typo in an error message. Approved by two reviewers and passed CI checks before integration.
76%
#157 fix: quote field names in error messages craft-application merged Merged a fix that quotes field names in error messages to improve tracking. Approved by two reviewers, passed CI, and maintained 100% test coverage on modified lines across two files.
73%
#5607 fix: typo in debugging docs snapcraft merged Merged a single-line typo fix in the debugging documentation. Approved by two reviewers, passed CI checks, and force-pushed to correct commit history before final merge.
71%
#1079 docs: fix terminal directive craft-application merged Merged a one-line documentation fix correcting the terminal directive rendering for multiline input. Approved by one reviewer with all CI checks passing.
71%
#1200 fix: indent multiline examples correctly craft-parts merged Merged a fix that correctly indents multiline examples. Approved by two reviewers and passed CI checks. Modified one file with 34 additions and 18 deletions.
71%
#445 fix(printer): handle multiline permanent progress correctly craft-cli open Fixes multiline permanent progress rendering in the printer so each terminal line is fully cleared and multiline messages log as separate timestamped lines. Pending review (0 reviewers); CI mostly green.
71%
#114 fix: docs inline code block was misplaced rockcraft merged Merged a one-line documentation fix correcting a misplaced inline code block. Approved by a reviewer, passed CI, and successfully resolved the formatting issue.
70%
#243 fix: don't fail parsing if line has no ':' fetch-service merged Merged a fix for parser failures on multi-line fields lacking colons. Refactored parsing to ignore colonless lines, skipping unneeded extra fields. Approved by two reviewers, passed CI, and resolves #240.
70%
#1738 fix(ci): fix merge event in tests charmcraft merged Merged a single-line fix to correct the merge event handling in CI tests. Approved by two reviewers and integrated with zero unresolved comments.
70%