Skip to content

Commit 4434e07

Browse files
committed
Add additional info to UnsupportedDefaultColorSpaceName exception.
1 parent f26a8ae commit 4434e07

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kernel/src/main/java/com/itextpdf/kernel/PdfException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public class PdfException extends RuntimeException {
305305
public static final String UnknownHashAlgorithm1 = "Unknown hash algorithm: {0}.";
306306
public static final String UnknownKeyAlgorithm1 = "Unknown key algorithm: {0}.";
307307
public static final String UnknownColorFormatMustBeRGBorRRGGBB = "Unknown color format: must be rgb or rrggbb.";
308-
public static final String UnsupportedDefaultColorSpaceName = "Unsupported default color space name.";
308+
public static final String UnsupportedDefaultColorSpaceName1 = "Unsupported default color space name. Was {0}, but should be DefaultCMYK, DefaultGray or DefaultRGB";
309309
public static final String UnsupportedXObjectType = "Unsupported XObject type.";
310310
public static final String VerificationAlreadyOutput = "Verification already output.";
311311
public static final String WhenAddingObjectReferenceToTheTagTreeItMustBeConnectedToNotFlushedObject = "When adding object reference to the tag tree, it must be connected to not flushed object.";

kernel/src/main/java/com/itextpdf/kernel/pdf/PdfResources.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ protected void setModified(boolean isModified) {
395395
public void setDefaultColorSpace(PdfName defaultCsKey, PdfColorSpace defaultCsValue) {
396396
if (!defaultCsKey.equals(PdfName.DefaultCMYK) && !defaultCsKey.equals(PdfName.DefaultGray) &&
397397
!defaultCsKey.equals(PdfName.DefaultRGB)) {
398-
throw new PdfException(PdfException.UnsupportedDefaultColorSpaceName);
398+
throw new PdfException(PdfException.UnsupportedDefaultColorSpaceName1).setMessageParams(defaultCsKey.toString());
399399
}
400400
addResource(defaultCsValue.getPdfObject(), PdfName.ColorSpace, defaultCsKey);
401401
}

0 commit comments

Comments
 (0)