Ver Fonte

fixing deadlock

reid há 2 anos atrás
pai
commit
bb2e7ba22c
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      broadcast/broadcast.go

+ 2 - 2
broadcast/broadcast.go

@@ -245,7 +245,7 @@ func UpdateBroadcastState(values map[string]interface{}) error {
 		}
 		if err := recursiveUpdate(field, val); err != nil {
 			mu.Unlock()
-			return err
+			return fmt.Errorf("error updating field %s: %v", key, err)
 		}
 	}
 	mu.Unlock()
@@ -256,7 +256,7 @@ func UpdateBroadcastState(values map[string]interface{}) error {
 // this allows us to insert stuff into nested structs/keys and not overwrite the existing contents
 func recursiveUpdate(dst, src reflect.Value) error {
 	if !dst.CanSet() {
-		return fmt.Errorf("field is not settable")
+		return fmt.Errorf("field (type: %s, kind: %s) is not settable", dst.Type(), dst.Kind())
 	}
 	// If dst is a struct and src is a map, handle them field by field
 	if dst.Kind() == reflect.Struct && src.Kind() == reflect.Map {