From ccc0dfdda64fc918fe7081fbe89c8a0ffa264685 Mon Sep 17 00:00:00 2001 From: mdb Date: Mon, 13 Aug 2007 21:47:56 +0000 Subject: [PATCH] Catch marshaller initialiation failure and report it more informatively. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2168 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../samskivert/jdbc/depot/PersistenceContext.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/java/com/samskivert/jdbc/depot/PersistenceContext.java b/src/java/com/samskivert/jdbc/depot/PersistenceContext.java index 17e71727..d0838181 100644 --- a/src/java/com/samskivert/jdbc/depot/PersistenceContext.java +++ b/src/java/com/samskivert/jdbc/depot/PersistenceContext.java @@ -220,10 +220,15 @@ public class PersistenceContext throws PersistenceException { DepotMarshaller marshaller = getRawMarshaller(type); - if (!marshaller.isInitialized()) { - // initialize the marshaller which may create or migrate the table for its underlying - // persistent object - marshaller.init(this); + try { + if (!marshaller.isInitialized()) { + // initialize the marshaller which may create or migrate the table for its + // underlying persistent object + marshaller.init(this); + } + } catch (PersistenceException pe) { + throw (PersistenceException)new PersistenceException( + "Failed to initialize marshaller [type=" + type + "].").initCause(pe); } return marshaller; }