home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / io / WriteAbortedException.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.4 KB  |  51 lines

  1. /*
  2.  * @(#)WriteAbortedException.java    1.5 98/03/18
  3.  *
  4.  * Copyright 1996, 1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17. /*
  18.  *
  19.  * @author  unascribed
  20.  * @version 1.5, 03/18/98
  21.  * @since   JDK1.1
  22.  */
  23. public class WriteAbortedException extends ObjectStreamException {
  24.     /*
  25.      */
  26.     public Exception detail;
  27.  
  28.     /**
  29.      * A WriteAbortedException is thrown during a read when one of the
  30.      * ObjectStreamExceptions was thrown during writing.  The exception
  31.      * that terminated the write can be found in the detail field.
  32.      * The stream is reset to it's initial state, all references to
  33.      * objects already deserialized are discarded.
  34.      */
  35.     public WriteAbortedException(String s, Exception ex) { 
  36.     super(s); 
  37.     detail = ex;
  38.     }
  39.  
  40.     /**
  41.      * Produce the message, include the message from the nested
  42.      * exception if there is one.
  43.      */
  44.     public String getMessage() {
  45.     if (detail == null) 
  46.         return super.getMessage();
  47.     else
  48.         return super.getMessage() + "; " + detail.toString();
  49.     }
  50. }
  51.