5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 16:51:16 +08:00

handle Set error on Update method

This commit is contained in:
Ilgıt Yıldırım 2020-09-12 11:35:20 +02:00 committed by Lea Anthony
parent 422ee22d0c
commit fe2c5e8611
2 changed files with 5 additions and 1 deletions

View File

@ -34,3 +34,4 @@ Wails is what it is because of the time and effort given by these great people.
* [Tim Kipp](https://github.com/timkippdev)
* [Dmitry Gomzyakov](https://github.com/kyoto44)
* [Arthur Wiebe](https://github.com/artooro)
* [Ilgıt Yıldırım](https://github.com/ilgityildirim)

View File

@ -286,5 +286,8 @@ func (s *Store) Update(updater interface{}) {
results := reflect.ValueOf(updater).Call(args)
// We will only have 1 result. Set the store to it
s.Set(results[0].Interface())
err = s.Set(results[0].Interface())
if err != nil && s.errorHandler != nil {
s.errorHandler(err)
}
}