Index: vhLib/LogOpkuiser.cls.xml =================================================================== diff -u -r3570 -r3791 --- vhLib/LogOpkuiser.cls.xml (.../LogOpkuiser.cls.xml) (revision 3570) +++ vhLib/LogOpkuiser.cls.xml (.../LogOpkuiser.cls.xml) (revision 3791) @@ -107,14 +107,22 @@ } Do ResultSet.Close() - Do ..Logger.%New("vhLib.Logger").Info("VerwijderLogRecords", "'" _ LoggingIdsToDelete.Count() _ "' te wissen voor datum '" _ Datum _ "', Niveau '" _ Niveau _ "'.") + Do ..Logger.Info("VerwijderLogRecords", "'" _ LoggingIdsToDelete.Count() _ "' te wissen voor datum '" _ Datum _ "', Niveau '" _ Niveau _ "'.") #Dim AantalGewist As %Integer = 0 Set IdsToDeleteIterator = ##class(TECH.ListIterator).%New( LoggingIdsToDelete ) While IdsToDeleteIterator.HasNext() { Set IdToDelete = IdsToDeleteIterator.Next() - Do ##class(vhLib.Logging).DeleteLogging(IdToDelete) - Set AantalGewist = AantalGewist + 1 + Try { + #dim sc As %Status = ##class(vhLib.Logging).DeleteLogging(IdToDelete) + Do ##class(TECH.Exceptions.StatusException).ThrowIndienNietOK(sc) + + Set AantalGewist = AantalGewist + 1 + } + Catch { + #dim Exception As TECH.Exceptions.Exception = ##class(TECH.ExceptionHandler).Catch() + Do ..Logger.ErrorMail("VerwijderLogRecords", "'" _ AantalGewist _ "' reeds gewist voor datum '" _ Datum _ "', Niveau '" _ Niveau _ "'. Error bij record '"_IdToDelete_"' : "_Exception.GeefErrorInformatie()) + } } Do:(LoggingIdsToDelete.Count() > 0) ..Logger.Info("VerwijderLogRecords", "'" _ AantalGewist _ "' gewist voor datum '" _ Datum _ "', Niveau '" _ Niveau _ "'.")