From 974d0ebccb7ee084785bb23712d21b18d047e627 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 8 Mar 2002 08:30:05 +0000 Subject: [PATCH] Wrap the ClassNotFoundException in an IOException. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1103 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/util/CompiledConfig.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/util/CompiledConfig.java b/src/java/com/threerings/util/CompiledConfig.java index 20c92ebe9..8ba6cb0a3 100644 --- a/src/java/com/threerings/util/CompiledConfig.java +++ b/src/java/com/threerings/util/CompiledConfig.java @@ -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); + } } /**