From eab57cd43bcfbd670a0741210332cf4ed0a71adf Mon Sep 17 00:00:00 2001 From: TobiasNx <61879957+TobiasNx@users.noreply.github.com> Date: Tue, 19 Nov 2024 09:26:49 +0100 Subject: [PATCH] Update Marc21Encoder.java Add leader hint to error message --- .../java/org/metafacture/biblio/marc21/Marc21Encoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java index fb8ad50b..c1f027d3 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java @@ -170,7 +170,7 @@ public void startEntity(final String name) { private void startField(final String name) { if (name.length() != NAME_LENGTH) { - throw new FormatException("invalid entity name: " + name); + throw new FormatException("invalid leader entity name: " + name); } final char[] tag = new char[RecordFormat.TAG_LENGTH]; final char[] indicators = new char[Marc21Constants.MARC21_FORMAT.getIndicatorLength()]; @@ -227,7 +227,7 @@ private void processLeaderAsOneLiteral(final String value) { private void processLeaderAsSubfields(final String name, final String value) { if (value.length() != 1) { throw new FormatException( - "literal must only contain a single character:" + name); + "leader literal must only contain a single character:" + name); } processLeaderAsSubfields(name, value.charAt(0)); } @@ -278,7 +278,7 @@ private void requireValidCode(final char code, final char[] validCodes) { return; } } - throw new FormatException("invalid code '" + code + "'; allowed codes are: " + Arrays.toString(validCodes)); + throw new FormatException("invalid code in leader'" + code + "'; allowed codes are: " + Arrays.toString(validCodes)); } }