From 6fd554de7ca50522e7874a45771c07922d19c1ce Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 13 Jun 2001 05:16:25 +0000 Subject: [PATCH] Be more verbose about logging typed object errors. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@37 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/presents/io/TypedObjectFactory.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/presents/io/TypedObjectFactory.java b/src/java/com/threerings/presents/io/TypedObjectFactory.java index 80123310a..8ecc18f7d 100644 --- a/src/java/com/threerings/presents/io/TypedObjectFactory.java +++ b/src/java/com/threerings/presents/io/TypedObjectFactory.java @@ -1,5 +1,5 @@ // -// $Id: TypedObjectFactory.java,v 1.5 2001/06/11 17:44:04 mdb Exp $ +// $Id: TypedObjectFactory.java,v 1.6 2001/06/13 05:16:25 mdb Exp $ package com.threerings.cocktail.cher.io; @@ -8,6 +8,8 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.util.HashMap; +import com.threerings.cocktail.cher.Log; + /** * The encodable factory is used to unserialize encodable object instances * from a stream. It maintains a mapping of encodable object classes to @@ -84,8 +86,12 @@ public class TypedObjectFactory try { return (TypedObject)clazz.newInstance(); } catch (Throwable t) { + Log.warning("Typed object error: " + t); + Log.logStackTrace(t); + String errmsg = "Unable to instantiate typed object " + - "[class=" + clazz.getName() + ", error=" + t + "]."; + "[class=" + clazz.getName() + + ", error=" + t.getMessage() + "]."; throw new ObjectStreamException(errmsg); } }