diff --git a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db index a17f4c1..a3c1877 100644 Binary files a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db and b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db differ diff --git a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db-shm b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db-shm index c9fcadf..b3bc90f 100644 Binary files a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db-shm and b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db-shm differ diff --git a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db-wal b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db-wal index 1847cb1..14977af 100644 Binary files a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db-wal and b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/CodeChunks.db-wal differ diff --git a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db index ab9afeb..4720ed3 100644 Binary files a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db and b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db differ diff --git a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db-shm b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db-shm index 790d170..9bd57ee 100644 Binary files a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db-shm and b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db-shm differ diff --git a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db-wal b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db-wal index f4e70ab..06d161c 100644 Binary files a/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db-wal and b/.vs/ToolCollection/CopilotIndices/17.14.1577.30250/SemanticSymbols.db-wal differ diff --git a/ToolCollection/frmNIHauptseite.vb b/ToolCollection/frmNIHauptseite.vb index 111ce28..8e0079b 100644 --- a/ToolCollection/frmNIHauptseite.vb +++ b/ToolCollection/frmNIHauptseite.vb @@ -313,8 +313,11 @@ Public Class frmNIHauptseite ' e.Cancel = True 'End If Dim _Fehler As Boolean = False + Dim _SkippedFilesCount As Integer = 0 ' ← Neu hinzufügen For Each profil As ClassNIProfil In ClassNIProfile.Profile _Fehler = False + _SkippedFilesCount = 0 + ' aktuelles Profil der Klasse mitteilen Me.aktivesProfil = profil _clsWorkfile = New clsNI_WorkFile(_MyLogger) @@ -501,42 +504,62 @@ Public Class frmNIHauptseite 'Dim _dok As WMObject '_dok = Nothing Try + ' Wichtig: aktivesDokument zurücksetzen + aktivesDokument = Nothing aktivesDokument = _windreamNI.oWMSession.GetWMObjectByPath(ConstWMEntityDocument, oFilenameWM) - Catch ex As Exception - _Logger.Warn($"ATTENTION: error while creating a windream-object via objectpath - ERROR [{ex.InnerException.Message}]") - _Logger.Warn($"Filename [{oFilenameWM}]") - _Logger.Error(ex) - bwProfil.ReportProgress(-4) - Exit Sub - End Try - If Not IsNothing(aktivesDokument) Then + If IsNothing(aktivesDokument) Then + _Logger.Warn($"ATTENTION: Could not create WMObject for path [{oFilenameWM}] - Object is Nothing. Skipping file...") + bwProfil.ReportProgress(-1) ' Fortschritt dennoch erhöhen + Continue For ' Nächste Datei + End If + _Logger.Debug($"..Got a windream-document-object for {aktivesDokument.aName}...") i += 1 + '####### Go für das Dokument ########## - ' Thread für diese Datei starten Me.startDateiDurchlauf() '###################################### - ' solange der Datei-Thread noch nicht abgeschlossen wurde While Me.bwDatei.IsBusy - End While + ' nächste Datei an ProgressBar2 bwProfil.ReportProgress(-1) oWorkCount += 1 + ' Vorgang abbrechen If bwProfil.CancellationPending Then _Logger.Info($"bwProfil.CancellationPending...Exit bwProfil_DoWork") Exit Sub ElseIf manually_cancel = True Then _Logger.Info($"manually_cancel...Exit bwProfil_DoWork") - Exit Sub End If - Else - _Logger.Error("Could not create a WMDocument via path!") - End If + + Catch ex As Exception + ' Fehler bei einzelner Datei - loggen und weitermachen + _Logger.Warn($"ATTENTION: Error processing document from path [{oFilenameWM}]") + _Logger.Warn($"Error: {ex.Message}") + + If ex.InnerException IsNot Nothing Then + _Logger.Warn($"InnerException: {ex.InnerException.Message}") + End If + + _Logger.Error(ex) + + Dim oLineNumber = GetLineNumber(ex) + If oLineNumber > 0 Then + _Logger.Warn($"#### Line Number: {oLineNumber} ####") + End If + _SkippedFilesCount += 1 ' ← Zähler erhöhen + ' Fortschritt trotzdem erhöhen + bwProfil.ReportProgress(-1) + + ' Weiter mit nächster Datei + _Logger.Info($"Skipping file and continuing with next document...") + Continue For + End Try Next Else _Logger.Error("ATTENTION: _windreamNI not intitialized properly...") @@ -587,6 +610,9 @@ Public Class frmNIHauptseite End If End If + If _SkippedFilesCount > 0 Then + _Logger.Warn($"#### Profile completed with {_SkippedFilesCount} skipped file(s) due to errors ####") + End If _Logger.Info("####################################################End Profile DoWork####") ' nächstes Profil an ProgressBar1 bwProfil.ReportProgress(-2) @@ -640,7 +666,26 @@ Public Class frmNIHauptseite ElseIf e.ProgressPercentage = -2 Then Me.ProgressBar1.Value += 1 ElseIf e.ProgressPercentage = -1 Then - Me.lblDatei.Text = Me.aktivesDokument.aName + Try + If Not IsNothing(Me.aktivesDokument) Then + Dim docName As String = Me.aktivesDokument.aName + If Not String.IsNullOrEmpty(docName) Then + Me.lblDatei.Text = docName + Else + Me.lblDatei.Text = "(Dateiname leer)" + End If + Else + ' Wenn aktivesDokument Nothing ist, dann war es ein Skip + Me.lblDatei.Text = "(Übersprungen)" + End If + Catch ex As Exception + ' Nur bei echtem Fehler + Me.lblDatei.Text = "(Fehler beim Laden)" + _Logger.Debug($"Error in ProgressChanged: {ex.Message}") + End Try + + Me.ProgressBar2.Value += 1 + Me.ProgressBar2.Value += 1 Else Me.ProgressBar2.Minimum = 0