Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func LoadConfig() (*Config, error) {
}
return &config, nil
}
return nil, err
return nil, fmt.Errorf("could not parse config file %s: %w", path, err)
}

config.DisableImages = raw.DisableImages
Expand Down
5 changes: 4 additions & 1 deletion config/keybinds.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package config
import (
_ "embed"
"encoding/json"
"log"

keybind "github.com/floatpane/go-keybind"
)
Expand Down Expand Up @@ -87,7 +88,9 @@ type DraftsKeys struct {
func defaultKeybinds() KeybindsConfig {
var kb KeybindsConfig
if err := json.Unmarshal(defaultKeybindsJSON, &kb); err != nil {
panic("matcha: malformed default_keybinds.json: " + err.Error())
// This should never happen — the embedded JSON is compiled into the
// binary. If it does, return empty keybinds rather than panicking.
log.Printf("matcha: malformed default_keybinds.json (using empty keybinds): %v", err)
}
return kb
}
Expand Down
Loading