Tailslide / fluxor-persist

Fluxor-persist is a library to persist Fluxor states.
MIT License
24 stars 13 forks source link

Add Try catch in the SetState method #11

Closed minhhieugma closed 1 year ago

minhhieugma commented 1 year ago

There are some situations in that exceptions might be raised inside the SetState method.

For example,

var str = JsonSerializer.Serialize(new CrashedState{Type = typeof(decimal)});

public class CrashedState
{
    public Type Type { get; set; }
}

So, Add Try catch and write some logs are useful here so that we can easily figure out the root cause. Originally, any exceptions raised inside are dismissed due to feature.StateChanged += Feature_StateChanged;