Catch marshaller initialiation failure and report it more informatively.

This commit is contained in:
Michael Bayne
2007-08-13 21:47:56 +00:00
parent f76ab3592a
commit d72ad79705
@@ -220,11 +220,16 @@ public class PersistenceContext
throws PersistenceException throws PersistenceException
{ {
DepotMarshaller<T> marshaller = getRawMarshaller(type); DepotMarshaller<T> marshaller = getRawMarshaller(type);
try {
if (!marshaller.isInitialized()) { if (!marshaller.isInitialized()) {
// initialize the marshaller which may create or migrate the table for its underlying // initialize the marshaller which may create or migrate the table for its
// persistent object // underlying persistent object
marshaller.init(this); marshaller.init(this);
} }
} catch (PersistenceException pe) {
throw (PersistenceException)new PersistenceException(
"Failed to initialize marshaller [type=" + type + "].").initCause(pe);
}
return marshaller; return marshaller;
} }