Elwig: Update Exception usage patterns

This commit is contained in:
lorenz.stechauner committed 2026-12-02 14:40:29 +01:00
1 parent 808e834284
commit 5cdb83601d
19 files changed
+54 -35

No files matched your search

+4 -4
View File
@@ -113,7 +113,7 @@ namespace Elwig.Helpers {
return pwd;
} catch { }
}
throw new InvalidDataException("No matching password found");
throw new ApplicationException("Kein passendes Passwort gefunden");
}
public static async Task<ReadOnlyMemory<char>> CheckIntegrity(this ZipArchive zip, IEnumerable<ReadOnlyMemory<char>> passwords) {
@@ -162,7 +162,7 @@ namespace Elwig.Helpers {
}
if (list.Count != 1 || list[0] != "ok") {
throw new FileFormatException($"Integrity problems ({list.Count}):\n" + string.Join("\n", list.Take(50)));
throw new DatabaseIntegrityException($"Integrity problems ({list.Count}):\n" + string.Join("\n", list.Take(50)));
}
}
@@ -176,7 +176,7 @@ namespace Elwig.Helpers {
}
if (list.Count != 1 || list[0] != "ok") {
throw new FileFormatException($"Integrity problems ({list.Count}):\n" + string.Join("\n", list.Take(50)));
throw new DatabaseIntegrityException($"Integrity problems ({list.Count}):\n" + string.Join("\n", list.Take(50)));
}
}
@@ -194,7 +194,7 @@ namespace Elwig.Helpers {
}
if (list.Count > 0) {
throw new InvalidDataException($"Foreign key violations ({list.Count}):\n" + string.Join("\n", list.Take(50)
throw new DatabaseForeignKeyViolationException($"Foreign key violations ({list.Count}):\n" + string.Join("\n", list.Take(50)
.Select(v => $"{v.Table} - {v.RowId} - {v.Parent} - {v.FkId}")));
}
}