home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / WriteAbortedException.java < prev    next >
Text File  |  1997-05-20  |  2KB  |  61 lines

  1. /*
  2.  * @(#)WriteAbortedException.java    1.3 97/01/22
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  */
  21.  
  22. package java.io;
  23.  
  24. /*
  25.  *
  26.  * @author  unascribed
  27.  * @version 1.3, 01/22/97
  28.  * @since   JDK1.1
  29.  */
  30. public class WriteAbortedException extends ObjectStreamException {
  31.     /*
  32.      * @since   JDK1.1
  33.      */
  34.     public Exception detail;
  35.  
  36.     /**
  37.      * A WriteAbortedException is thrown during a read when one of the
  38.      * ObjectStreamExceptions was thrown during writing.  The exception
  39.      * that terminated the write can be found in the detail field.
  40.      * The stream is reset to it's initial state, all references to
  41.      * objects already deserialized are discarded.
  42.      * @since   JDK1.1
  43.      */
  44.     public WriteAbortedException(String s, Exception ex) { 
  45.     super(s); 
  46.     detail = ex;
  47.     }
  48.  
  49.     /**
  50.      * Produce the message, include the message from the nested
  51.      * exception if there is one.
  52.      * @since   JDK1.1
  53.      */
  54.     public String getMessage() {
  55.     if (detail == null) 
  56.         return super.getMessage();
  57.     else
  58.         return super.getMessage() + "; " + detail.toString();
  59.     }
  60. }
  61.