diff --git a/src/GUI/Shared/Handlers/ReverseEngineer/ReverseEngineerHandler.cs b/src/GUI/Shared/Handlers/ReverseEngineer/ReverseEngineerHandler.cs index f574b298d..d7ff2b8ec 100644 --- a/src/GUI/Shared/Handlers/ReverseEngineer/ReverseEngineerHandler.cs +++ b/src/GUI/Shared/Handlers/ReverseEngineer/ReverseEngineerHandler.cs @@ -453,10 +453,25 @@ private async Task LoadDataBaseObjectsAsync(ReverseEngineerOptions options { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); - await VS.StatusBar.StartAnimationAsync(StatusAnimation.Build); - var predefinedTables = !string.IsNullOrEmpty(options.Dacpac) - ? await GetDacpacTablesAsync(options.Dacpac, options.CodeGenerationMode) - : await GetTablesAsync(dbInfo, options.CodeGenerationMode, options.Schemas?.ToArray()); + IEnumerable predefinedTables = null; + + try + { + await VS.StatusBar.StartAnimationAsync(StatusAnimation.Build); + + predefinedTables = !string.IsNullOrEmpty(options.Dacpac) + ? await GetDacpacTablesAsync(options.Dacpac, options.CodeGenerationMode) + : await GetTablesAsync(dbInfo, options.CodeGenerationMode, options.Schemas?.ToArray()); + } + catch (InvalidOperationException ex) + { + VSHelper.ShowError($"{ex.Message}"); + return false; + } + finally + { + await VS.StatusBar.EndAnimationAsync(StatusAnimation.Build); + } var isSqliteToolboxInstalled = options.DatabaseType != DatabaseType.SQLite;