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
This commit is contained in:
@@ -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;
|
package com.threerings.cocktail.cher.io;
|
||||||
|
|
||||||
@@ -8,6 +8,8 @@ import java.io.DataInputStream;
|
|||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import com.threerings.cocktail.cher.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The encodable factory is used to unserialize encodable object instances
|
* The encodable factory is used to unserialize encodable object instances
|
||||||
* from a stream. It maintains a mapping of encodable object classes to
|
* from a stream. It maintains a mapping of encodable object classes to
|
||||||
@@ -84,8 +86,12 @@ public class TypedObjectFactory
|
|||||||
try {
|
try {
|
||||||
return (TypedObject)clazz.newInstance();
|
return (TypedObject)clazz.newInstance();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
Log.warning("Typed object error: " + t);
|
||||||
|
Log.logStackTrace(t);
|
||||||
|
|
||||||
String errmsg = "Unable to instantiate typed object " +
|
String errmsg = "Unable to instantiate typed object " +
|
||||||
"[class=" + clazz.getName() + ", error=" + t + "].";
|
"[class=" + clazz.getName() +
|
||||||
|
", error=" + t.getMessage() + "].";
|
||||||
throw new ObjectStreamException(errmsg);
|
throw new ObjectStreamException(errmsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user