fix(store): replace panic with error return, handle unmarshal errors
generateToken() now returns (string, error) instead of panicking on crypto/rand failure. All json.Unmarshal calls for alert settings now check and propagate errors instead of silently ignoring them. Adds Close() to Store interface for graceful shutdown support. Skips malformed notification entries during Kuma import.
This commit is contained in:
@@ -64,6 +64,7 @@ func (m *mockStore) DeleteMaintenanceWindow(int) error { retur
|
||||
func (m *mockStore) IsMonitorInMaintenance(int) (bool, error) { return false, nil }
|
||||
func (m *mockStore) GetPreference(string) (string, error) { return "", nil }
|
||||
func (m *mockStore) SetPreference(string, string) error { return nil }
|
||||
func (m *mockStore) Close() error { return nil }
|
||||
|
||||
func TestMetricsHandler(t *testing.T) {
|
||||
ms := &mockStore{
|
||||
|
||||
Reference in New Issue
Block a user