Skip to content

Commit

Permalink
fix: Don't panic on unexpected bubbletea messages
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed May 30, 2024
1 parent 6845ab9 commit 788f805
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/cmd/readhttpresponse.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"fmt"
"io"
"net/http"
"strings"
Expand Down Expand Up @@ -62,10 +61,8 @@ func (m httpProgressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
default:
return m, nil
}
case tea.WindowSizeMsg:
return m, nil
default:
panic(fmt.Sprintf("%T: unknown message type", msg))
return m, nil
}
}

Expand Down Expand Up @@ -101,10 +98,8 @@ func (m httpSpinnerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
default:
return m, nil
}
case tea.WindowSizeMsg:
return m, nil
default:
panic(fmt.Sprintf("%T: unknown message type", msg))
return m, nil
}
}

Expand Down

0 comments on commit 788f805

Please sign in to comment.