mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-09 11:03:12 +00:00
Human friendly error message for invalid md field
Also clean up the code log/print spit this out
This commit is contained in:
@@ -116,24 +116,8 @@ public abstract class DSpaceObject
|
|||||||
if (dcFields[dcIdx] == null)
|
if (dcFields[dcIdx] == null)
|
||||||
{
|
{
|
||||||
// Bad DC field, log and throw exception
|
// Bad DC field, log and throw exception
|
||||||
log.warn(LogManager
|
log.warn("Invalid metadata field: [" + dcv.getField() + "] : [" + dcv.value + "]");
|
||||||
.getHeader(ourContext, "bad_dc",
|
throw new SQLException("Invalid metadata field: [" + dcv.getField() + "]");
|
||||||
"Bad DC field. schema=" + dcv.schema
|
|
||||||
+ ", element: \""
|
|
||||||
+ ((dcv.element == null) ? "null"
|
|
||||||
: dcv.element)
|
|
||||||
+ "\" qualifier: \""
|
|
||||||
+ ((dcv.qualifier == null) ? "null"
|
|
||||||
: dcv.qualifier)
|
|
||||||
+ "\" value: \""
|
|
||||||
+ ((dcv.value == null) ? "null"
|
|
||||||
: dcv.value) + "\""
|
|
||||||
));
|
|
||||||
|
|
||||||
throw new SQLException("bad_dublin_core "
|
|
||||||
+ "schema="+dcv.schema+", "
|
|
||||||
+ dcv.element
|
|
||||||
+ " " + dcv.qualifier);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user