[chore:] logging for AddressCheck.cs
This commit is contained in:
+15
-2
@@ -38,6 +38,8 @@ public class AddressCheck
|
||||
}
|
||||
|
||||
public async Task<List<KasPerson>> Perform(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Find the index of the address set with the given id
|
||||
var adset_index = -1;
|
||||
@@ -238,7 +240,8 @@ public class AddressCheck
|
||||
// Directly set PersonError in the address set
|
||||
var person_index = adset.KasPersons.IndexOf(person);
|
||||
if (person_index >= 0)
|
||||
Settings._instance.addressSets.addresses[adset_index].KasPersons[person_index].PersonError =
|
||||
Settings._instance.addressSets.addresses[adset_index].KasPersons[person_index]
|
||||
.PersonError =
|
||||
new KasPersonError((errors, warnings));
|
||||
}
|
||||
|
||||
@@ -248,7 +251,8 @@ public class AddressCheck
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
if (hasFaults)
|
||||
_progress.AddToLog($"Person mit id {person.id} ist fehlerhaft", Convert.ToInt32(percent).ToString());
|
||||
_progress.AddToLog($"Person mit id {person.id} ist fehlerhaft",
|
||||
Convert.ToInt32(percent).ToString());
|
||||
|
||||
_progress.ChangePercentage(percent);
|
||||
});
|
||||
@@ -261,5 +265,14 @@ public class AddressCheck
|
||||
return Settings._instance.addressSets.addresses[adset_index].KasPersons
|
||||
.Where(p => p.PersonError != null)
|
||||
.ToList();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log($"Error while performing address check: {ex.Message}", Logger.LogType.Error);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user