Skip to content

Commit eab57cd

Browse files
authored
Update Marc21Encoder.java
Add leader hint to error message
1 parent 29b9759 commit eab57cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public void startEntity(final String name) {
170170

171171
private void startField(final String name) {
172172
if (name.length() != NAME_LENGTH) {
173-
throw new FormatException("invalid entity name: " + name);
173+
throw new FormatException("invalid leader entity name: " + name);
174174
}
175175
final char[] tag = new char[RecordFormat.TAG_LENGTH];
176176
final char[] indicators = new char[Marc21Constants.MARC21_FORMAT.getIndicatorLength()];
@@ -227,7 +227,7 @@ private void processLeaderAsOneLiteral(final String value) {
227227
private void processLeaderAsSubfields(final String name, final String value) {
228228
if (value.length() != 1) {
229229
throw new FormatException(
230-
"literal must only contain a single character:" + name);
230+
"leader literal must only contain a single character:" + name);
231231
}
232232
processLeaderAsSubfields(name, value.charAt(0));
233233
}
@@ -278,7 +278,7 @@ private void requireValidCode(final char code, final char[] validCodes) {
278278
return;
279279
}
280280
}
281-
throw new FormatException("invalid code '" + code + "'; allowed codes are: " + Arrays.toString(validCodes));
281+
throw new FormatException("invalid code in leader'" + code + "'; allowed codes are: " + Arrays.toString(validCodes));
282282
}
283283
}
284284

0 commit comments

Comments
 (0)