From 553f56ecaf1dff1a0573abd20616962f173dc293 Mon Sep 17 00:00:00 2001 From: Glax Date: Wed, 4 Dec 2024 19:49:26 +0100 Subject: [PATCH] Longer ExceptionMessage when Chapter comparison fails #289 --- Tranga/Chapter.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tranga/Chapter.cs b/Tranga/Chapter.cs index d2fc000..5409096 100644 --- a/Tranga/Chapter.cs +++ b/Tranga/Chapter.cs @@ -75,7 +75,11 @@ public readonly struct Chapter : IComparable _ => chapterNumberFloat.CompareTo(otherChapterNumberFloat) }; } - else throw new FormatException($"Value could not be parsed"); + else throw new FormatException($"Value could not be parsed.\n" + + $"\tVolumeNumber: '{volumeNumber}' ChapterNumber: '{chapterNumber}'\n" + + $"\tOther-VolumeNumber: '{otherChapter.volumeNumber}' Other-ChapterNumber: '{otherChapter.chapterNumber}'\n" + + $"\t{this}\n" + + $"\t{otherChapter}"); } ///