Explorar el Código

fixing deadlock

reid hace 2 años
padre
commit
bb2e7ba22c
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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 {