Skip to content

Commit

Permalink
imp - Expand invalid vCard/vCalendar message
Browse files Browse the repository at this point in the history
---

To make this message more cohesive, we've decided to expand it a bit to indicate what exactly we're dealing with (vCard and vCalendar).

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 8, 2024
1 parent 20b9485 commit 23fbc51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions VisualCard.Calendar/CalendarTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static Parts.Calendar[] GetCalendars(StreamReader stream)

// All vCalendars must begin with BEGIN:VCALENDAR
if (!prefix.EqualsNoCase(VcardConstants._beginSpecifier) && !value.EqualsNoCase(VCalendarConstants._objectVCalendarSpecifier) && !BeginSpotted)
throw new InvalidDataException($"This is not a valid vCalendar file.");
throw new InvalidDataException("This is not a valid vCalendar file.");
else if (!BeginSpotted)
{
BeginSpotted = true;
Expand All @@ -134,7 +134,7 @@ public static Parts.Calendar[] GetCalendars(StreamReader stream)
if (prefix.EqualsNoCase(VcardConstants._versionSpecifier) &&
!value.EqualsNoCase("1.0") && !value.EqualsNoCase("2.0") &&
!VersionSpotted)
throw new InvalidDataException($"This has an invalid vCalendar version {CalendarLine}.");
throw new InvalidDataException($"This calendar has an invalid vCalendar version {CalendarLine}.");
else if (!VersionSpotted && prefix.EqualsNoCase(VcardConstants._versionSpecifier))
{
VersionSpotted = true;
Expand Down
4 changes: 2 additions & 2 deletions VisualCard/CardTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static Card[] GetCards(StreamReader stream)

// All VCards must begin with BEGIN:VCARD
if (!prefix.EqualsNoCase(VcardConstants._beginSpecifier) && !value.EqualsNoCase(VcardConstants._objectVCardSpecifier) && !BeginSpotted)
throw new InvalidDataException($"This is not a valid VCard contact file.");
throw new InvalidDataException("This is not a valid vCard contact file.");
else if (!BeginSpotted)
{
BeginSpotted = true;
Expand All @@ -174,7 +174,7 @@ public static Card[] GetCards(StreamReader stream)
!value.EqualsNoCase("2.1") && !value.EqualsNoCase("3.0") &&
!value.EqualsNoCase("4.0") && !value.EqualsNoCase("5.0") &&
!VersionSpotted)
throw new InvalidDataException($"This has an invalid VCard version {CardLine}.");
throw new InvalidDataException($"This card has an invalid VCard version {CardLine}.");
else if (!VersionSpotted && prefix.EqualsNoCase(VcardConstants._versionSpecifier))
{
VersionSpotted = true;
Expand Down

0 comments on commit 23fbc51

Please sign in to comment.