Skip to content

Commit

Permalink
MM-54313 - Fix: panic in handleGetAllChannels (#511)
Browse files Browse the repository at this point in the history
* fix MM-54313

* wrap appErr
  • Loading branch information
cpoile authored Aug 31, 2023
1 parent 1ee23b8 commit fe6f2e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (p *Plugin) handleGetAllChannels(w http.ResponseWriter, r *http.Request) {
state, err := p.kvGetChannelState(channelID, false)
if err != nil {
p.LogError(err.Error())
http.Error(w, appErr.Error(), http.StatusInternalServerError)
continue
}

enabled := state.Enabled
Expand Down
2 changes: 1 addition & 1 deletion server/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (p *Plugin) KVGet(key string, fromWriter bool) ([]byte, error) {
if !fromWriter {
data, appErr := p.API.KVGet(key)
if appErr != nil {
return nil, appErr
return nil, fmt.Errorf("failed to kvget for key: %s error: %w", key, appErr)
}
return data, nil
}
Expand Down

0 comments on commit fe6f2e0

Please sign in to comment.