Skip to content

fix: log file write and close errors in debug image protocol logger#1340

Open
MD-Mushfiqur123 wants to merge 1 commit into
floatpane:masterfrom
MD-Mushfiqur123:fix/file-write-errors-debug-logger
Open

fix: log file write and close errors in debug image protocol logger#1340
MD-Mushfiqur123 wants to merge 1 commit into
floatpane:masterfrom
MD-Mushfiqur123:fix/file-write-errors-debug-logger

Conversation

@MD-Mushfiqur123
Copy link
Copy Markdown
Contributor

Fixes #751. File write and close errors in the debug image protocol logger are now logged instead of being silently ignored with _ = assignments.

@MD-Mushfiqur123 MD-Mushfiqur123 requested a review from a team as a code owner May 22, 2026 06:11
@floatpanebot floatpanebot added the area/tui Terminal UI / view layer label May 22, 2026
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @MD-Mushfiqur123! Please fix the following issues with your PR:

  • Title: Is too long (67 characters). The PR title must be strictly under 40 characters.
  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@floatpanebot floatpanebot added bug Something isn't working size/S Diff: 11–50 lines labels May 22, 2026
Copy link
Copy Markdown
Member

@FromSi FromSi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR currently has a content conflict with origin/master in view/html.go.

Please rebase/merge the latest master and re-apply this change on top of the current debugImageProtocol implementation. In particular, keep the existing //nolint:gosec comments on the os.OpenFile lines while wrapping the WriteString and Close calls with error logging.

Comment thread view/html.go
_, _ = f.WriteString(msg)
_ = f.Close()
if _, err := f.WriteString(msg); err != nil {
log.Printf("debug log write error: %v", err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use loglevel.Debugf

Comment thread view/html.go
log.Printf("debug log write error: %v", err)
}
if err := f.Close(); err != nil {
log.Printf("debug log close error: %v", err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use loglevel.Debugf

Comment thread view/html.go
_, _ = f.WriteString(msg)
_ = f.Close()
if _, err := f.WriteString(msg); err != nil {
log.Printf("debug log write error: %v", err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use loglevel.Debugf

Comment thread view/html.go
log.Printf("debug log write error: %v", err)
}
if err := f.Close(); err != nil {
log.Printf("debug log close error: %v", err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use loglevel.Debugf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui Terminal UI / view layer bug Something isn't working size/S Diff: 11–50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: File write errors ignored in debug logger

3 participants