From fe2c5e86116fd8bab3157078db441fe0146881ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilg=C4=B1t=20Y=C4=B1ld=C4=B1r=C4=B1m?= Date: Sat, 12 Sep 2020 11:35:20 +0200 Subject: [PATCH] handle Set error on Update method --- CONTRIBUTORS.md | 1 + runtime/store.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 27107b27e..6fd0fb999 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -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) diff --git a/runtime/store.go b/runtime/store.go index 1da67870b..ff024d7b6 100644 --- a/runtime/store.go +++ b/runtime/store.go @@ -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) + } }