home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / java / appleevent send and receive / source / shared sources / nativeexception.java < prev    next >
Encoding:
Java Source  |  2000-06-23  |  1.5 KB  |  51 lines

  1. /**
  2.  * Apple Worldwide Developer Technical Support
  3.  *
  4.  * Sample showing how to send and receive AppleEvents using JDirect 2.
  5.  *
  6.  * File: NativeException.java
  7.  *
  8.  * This class represents a native error returned from a JDirect 2 Mac OS Toolbox call.
  9.  *
  10.  * @author Levi Brown
  11.  * @author Apple Computer, Inc.
  12.  *
  13.  * Copyright ©1999 Apple Computer, Inc.
  14.  * All rights reserved.
  15.  *
  16.  * @version 1.0
  17.  * 4/15/1999 Shipped as 'AppleEvent Send and Receive' sample.
  18.  *
  19.  * You may incorporate this sample code into your applications without
  20.  * restriction, though the sample code has been provided "AS IS" and the
  21.  * responsibility for its operation is 100% yours.  However, what you are
  22.  * not permitted to do is to redistribute the source as "Apple Sample
  23.  * Code" after having made changes. If you're going to re-distribute the
  24.  * source, we require that you make it clear in the source that the code
  25.  * was descended from Apple Sample Code, but that you've made changes.
  26.  */
  27. public class NativeException extends Exception
  28. {
  29.     /**
  30.      * Create a new NativeException object with a message and a corresponding error number.
  31.      * @param the message associated with this exception.
  32.      * @param the native error number causing the exception.
  33.      */
  34.     public NativeException(String message, short errorNum)
  35.     {
  36.         super(message);
  37.         
  38.         this.errNum = errNum;
  39.     }
  40.     
  41.     /**
  42.      * Get the native error number associated with this exception.
  43.      * @return the error number.
  44.      */
  45.     public short getErrNum()
  46.     {
  47.         return errNum;
  48.     }
  49.     
  50.     protected short errNum;
  51. }