-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Exception messages when working on "leader" #573
base: master
Are you sure you want to change the base?
Conversation
…ithub.com:metafacture/metafacture-core
Add leader hint to error message
metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside the one mentioned other messages are OK.
@@ -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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dr0i is it possible to add the info about the leader element? like this:
throw new FormatException("invalid code in leader'" + code + "'; allowed codes are: " + Arrays.toString(validCodes)); | |
throw new FormatException("invalid code in leader literal literal'" + name + code + "'; allowed codes are: " + Arrays.toString(validCodes)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've proposed to add literal literal
as message. And a variable name
which is not declared in the method nor globally (meaning: you cannot use it here).
What you probably meant to output was something like e.g. TYPE_OF_CONTROL_CODES
or ENCODING_LEVEL_CODES
so that a librarian knows what leader position is wrong? We could do this, but have to pass this information somehow into the method via a parameter.
…/Marc21Encoder.java
Note: don't use titles like |
Add leader hint to error message. See #573
Open adjust the message:
metafacture-core/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java
Line 160 in eab57cd
metafacture-core/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java
Line 208 in eab57cd
Also it would be greate to hint, which leader position or position name which is wrong.