main.go error-color split breaks on multi-line error bodies #603
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/thwap-pagesd#603
Loading…
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?
main()incmd/tpagectl/main.gocolors the first line ofclierr.Render(err)red by splitting on the first\n. When the friendly status detail embeds a multi-line response body (a 5xx/401 with an indented or multi-line body), the split lands mid-error: only the first fragment gets the red style and thehint:line is folded into the remaining text via the secondFprintln. All text is still printed, but the styling and hint separation are mangled.Split on the
hint:marker (or color the whole message) instead of the first newline.See #602
Fixed in #634:
main()colors only the leadingerror:prefix and prints the whole rendered message unchanged, so multi-line bodies andhint:lines are no longer mangled.