Wrap the ClassNotFoundException in an IOException.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1103 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-03-08 08:30:05 +00:00
parent 782bd9b7d9
commit 974d0ebccb
@@ -1,5 +1,5 @@
//
// $Id: CompiledConfig.java,v 1.1 2002/03/08 06:15:21 mdb Exp $
// $Id: CompiledConfig.java,v 1.2 2002/03/08 08:30:05 mdb Exp $
package com.threerings.yohoho.util;
@@ -11,6 +11,8 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import com.samskivert.io.NestableIOException;
/**
* Used to load and store compiled configuration data (generally XML files
* that are parsed into Java object models and then serialized for rapid
@@ -22,10 +24,15 @@ public class CompiledConfig
* Unserializes a configuration object from the supplied input stream.
*/
public static Serializable loadConfig (InputStream source)
throws IOException, ClassNotFoundException
throws IOException
{
ObjectInputStream oin = new ObjectInputStream(source);
return (Serializable)oin.readObject();
try {
ObjectInputStream oin = new ObjectInputStream(source);
return (Serializable)oin.readObject();
} catch (ClassNotFoundException cnfe) {
String errmsg = "Unknown config class";
throw new NestableIOException(errmsg, cnfe);
}
}
/**