Skip to content

Commit

Permalink
Handle unexpected error from context
Browse files Browse the repository at this point in the history
  • Loading branch information
c032 committed Feb 10, 2024
1 parent 8f38744 commit 2728b06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion i3statusline.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"sync/atomic"
Expand Down Expand Up @@ -146,7 +147,7 @@ func (i3sl *i3StatusLine) Run() error {
err := ctx.Err()
if err != nil {
if !errors.Is(err, context.Canceled) {
return nil
return fmt.Errorf("unexpected error: %w", err)
}

cause := context.Cause(ctx)
Expand Down

0 comments on commit 2728b06

Please sign in to comment.