diff --git a/src/UglyToad.PdfPig/Parser/Parts/DirectObjectFinder.cs b/src/UglyToad.PdfPig/Parser/Parts/DirectObjectFinder.cs index eb085a47..39b88528 100644 --- a/src/UglyToad.PdfPig/Parser/Parts/DirectObjectFinder.cs +++ b/src/UglyToad.PdfPig/Parser/Parts/DirectObjectFinder.cs @@ -76,7 +76,7 @@ } } - throw new PdfDocumentFormatException($"Could not find the object number {reference} with type {typeof(T).Name}."); + throw new PdfDocumentFormatException($"Could not find the object number {reference} with type {typeof(T).Name} instead, it was found with type {temp.GetType().Name}."); } public static T Get(IToken token, IPdfTokenScanner scanner) where T : class, IToken @@ -91,7 +91,7 @@ return Get(reference.Data, scanner); } - throw new PdfDocumentFormatException($"Could not find the object {token} with type {typeof(T).Name}."); + throw new PdfDocumentFormatException($"Could not find the object {token} with type {typeof(T).Name} instead, it was found with type {token.GetType().Name}."); } } }