diff --git a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/MoveDataConnectionDialog.razor b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/MoveDataConnectionDialog.razor index aac4198e..dba97fa4 100644 --- a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/MoveDataConnectionDialog.razor +++ b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/MoveDataConnectionDialog.razor @@ -88,18 +88,24 @@ _busy = true; _error = null; - var result = await MoveService.MoveAsync(ConnectionId, target); - _busy = false; + try + { + var result = await MoveService.MoveAsync(ConnectionId, target); - if (result.Success) - { - await IsVisibleChanged.InvokeAsync(false); - await OnMoved.InvokeAsync(); + if (result.Success) + { + await IsVisibleChanged.InvokeAsync(false); + await OnMoved.InvokeAsync(); + } + else + { + // Surface the server guard error inline; keep the dialog open. + _error = result.Error ?? "Move failed."; + } } - else + finally { - // Surface the server guard error inline; keep the dialog open. - _error = result.Error ?? "Move failed."; + _busy = false; } } }