001    /*
002     * @(#)FitsException.java     $Revision: 1.4 $    $Date: 2000/01/07 14:47:24 $
003     *
004     * Copyright (C) 1999 European Southern Observatory 
005     * License:  GNU General Public License version 2 or later
006     */
007    package org.eso.fits;
008    
009    import java.lang.*;
010    
011    /** FitsException defines special exception for the FITS package
012     *  HD unit or as an image extension.
013     *
014     *  @version $Revision: 1.4 $ $Date: 2000/01/07 14:47:24 $
015     *  @author  P.Grosbol, DMD/ESO, <pgrosbol@eso.org>
016     */
017    public class FitsException extends Exception {
018        
019        /** Define FITS exception types */
020        final public static int NONE = 0;
021        final public static int FILE = 1;
022        final public static int KEYWORD = 2;
023        final public static int ENDCARD = 3;
024        final public static int HEADER = 4;
025        final public static int DATA = 5;
026        final public static int NOHEADERSPACE = 6;
027    
028        private int type = NONE;
029    
030        /** Default constructor for FitsExtension class */
031        public FitsException() {
032            super();
033            this.type = NONE;
034        }
035    
036        /** Constructor for FitsExtension class specifying a message.
037         *
038         *  @param mess   error message for exception */
039        public FitsException(String mess) {
040            super(mess);
041            this.type = NONE;
042        }
043    
044        /** Constructor for FitsExtension class specifying message and type.
045         *
046         *  @param mess  error message for exception
047         *  @param type  FITS exception tyep */
048        public FitsException(String mess, int type) {
049            super(mess);
050            this.type = type;
051        }
052    
053        /** Get FITS exception type */
054        public int getType(){
055            return type;
056        }
057    }
058    
059    
060    
061    
062    
063