Fix exception messages: these showed e.g.

"The cm operator must pass 6 numbers. Instead got: Decimal[]"
instead of
"The cm operator must pass 6 numbers. Instead got: 4"
This commit is contained in:
Mark van 't Zet 2023-09-12 16:56:13 +02:00 committed by BobLd
parent ee756088d9
commit d59d2c61a0
5 changed files with 6 additions and 6 deletions

View File

@ -81,7 +81,7 @@
}
else
{
throw new InvalidOperationException($"Expected four values for the font matrix, instead got: {array}.");
throw new InvalidOperationException($"Expected four values for the font matrix, instead got: {array.Length}.");
}
}
break;

View File

@ -403,7 +403,7 @@
{
if (optionArrayToken.Length != 2)
{
throw new PdfDocumentFormatException($"An option array containing array elements should contain 2 strings, instead got: {optionArrayToken}.");
throw new PdfDocumentFormatException($"An option array containing array elements should contain 2 strings, instead got: {optionArrayToken.Length}.");
}
string exportValue;

View File

@ -36,7 +36,7 @@
if (value.Length != 6)
{
throw new ArgumentException("The cm operator must pass 6 numbers. Instead got: " + value);
throw new ArgumentException("The cm operator must pass 6 numbers. Instead got: " + value.Length);
}
Value = value;
}

View File

@ -31,7 +31,7 @@
{
if (value.Length != 6)
{
throw new ArgumentException("Text matrix must provide 6 values. Instead got: " + value);
throw new ArgumentException("Text matrix must provide 6 values. Instead got: " + value.Length);
}
Value = value;

View File

@ -169,7 +169,7 @@
if (array.Data.Count != 4)
{
throw new PdfDocumentFormatException($"Cannot convert array to rectangle, expected 4 values instead got: {array}.");
throw new PdfDocumentFormatException($"Cannot convert array to rectangle, expected 4 values instead got: {array.Data.Count}.");
}
return new PdfRectangle(DirectObjectFinder.Get<NumericToken>(array[0], tokenScanner).Double,
@ -187,7 +187,7 @@
if (array.Data.Count != 4)
{
throw new PdfDocumentFormatException($"Cannot convert array to rectangle, expected 4 values instead got: {array}.");
throw new PdfDocumentFormatException($"Cannot convert array to rectangle, expected 4 values instead got: {array.Data.Count}.");
}
return new PdfRectangle(DirectObjectFinder.Get<NumericToken>(array[0], tokenScanner).Int,