Skip to content

Commit

Permalink
Update Marc21Encoder.java
Browse files Browse the repository at this point in the history
Add leader hint to error message
  • Loading branch information
TobiasNx authored Nov 19, 2024
1 parent 29b9759 commit eab57cd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()];
Expand Down Expand Up @@ -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));
}
Expand Down Expand Up @@ -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));
}
}

Expand Down

0 comments on commit eab57cd

Please sign in to comment.