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

+1 -1
View File
@@ -132,7 +132,7 @@ namespace Elwig.Documents {
}
protected override void RenderBody(iText.Layout.Document doc, PdfDocument pdf) {
if (_data == null) throw new Exception("Call LoadData before RenderBody");
if (_data == null) throw new InvalidOperationException("Call LoadData before RenderBody");
base.RenderBody(doc, pdf);
doc.Add(NewCreditTable(_data));
+2 -2
View File
@@ -51,7 +51,7 @@ namespace Elwig.Documents {
}
protected override void BeforeRenderBody(iText.Layout.Document doc, PdfDocument pdf) {
if (Data == null) throw new Exception("Call LoadData before BeforeRenderBody");
if (Data == null) throw new InvalidOperationException("Call LoadData before BeforeRenderBody");
base.BeforeRenderBody(doc, pdf);
var firstDay = Data.Rows.MinBy(r => r.Date)?.Date;
var lastDay = Data.Rows.MaxBy(r => r.Date)?.Date;
@@ -62,7 +62,7 @@ namespace Elwig.Documents {
}
protected override void RenderBody(iText.Layout.Document doc, PdfDocument pdf) {
if (Season == null || Data == null) throw new Exception("Call LoadData before RenderBody");
if (Season == null || Data == null) throw new InvalidOperationException("Call LoadData before RenderBody");
base.RenderBody(doc, pdf);
doc.Add(NewDeliveryListTable(Data));
+1 -1
View File
@@ -57,7 +57,7 @@ namespace Elwig.Documents {
}
protected override void RenderBody(iText.Layout.Document doc, PdfDocument pdf) {
if (Season == null) throw new Exception("Call LoadData before RenderBody");
if (Season == null) throw new InvalidOperationException("Call LoadData before RenderBody");
base.RenderBody(doc, pdf);
doc.Add(NewMemberData(Season).SetMarginBottomMM(5));
doc.Add(NewBucketTable(Season, MemberBuckets, MemberDeliveredWeightRed, MemberDeliveredWeightWhite, includeDelivery: false));
+1 -1
View File
@@ -60,7 +60,7 @@ namespace Elwig.Documents {
}
protected override void RenderBody(iText.Layout.Document doc, PdfDocument pdf) {
if (Data == null || Modifiers == null || ModifierStat == null) throw new Exception("Call LoadData before RenderBody");
if (Data == null || Modifiers == null || ModifierStat == null) throw new InvalidOperationException("Call LoadData before RenderBody");
base.RenderBody(doc, pdf);
doc.Add(new KernedParagraph($"{Name} Lese {Variant.Year}", 24)
.SetTextAlignment(TextAlignment.CENTER).SetFont(BF)