Catch marshaller initialiation failure and report it more informatively.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2168 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2007-08-13 21:47:56 +00:00
parent ac3ab74a4b
commit ccc0dfdda6
@@ -220,10 +220,15 @@ public class PersistenceContext
throws PersistenceException throws PersistenceException
{ {
DepotMarshaller<T> marshaller = getRawMarshaller(type); DepotMarshaller<T> marshaller = getRawMarshaller(type);
if (!marshaller.isInitialized()) { try {
// initialize the marshaller which may create or migrate the table for its underlying if (!marshaller.isInitialized()) {
// persistent object // initialize the marshaller which may create or migrate the table for its
marshaller.init(this); // underlying persistent object
marshaller.init(this);
}
} catch (PersistenceException pe) {
throw (PersistenceException)new PersistenceException(
"Failed to initialize marshaller [type=" + type + "].").initCause(pe);
} }
return marshaller; return marshaller;
} }