1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright 2003,2004 The Apache Software Foundation.
   7  *
   8  * Licensed under the Apache License, Version 2.0 (the "License");
   9  * you may not use this file except in compliance with the License.
  10  * You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.xs;
  22 
  23 /**
  24  * The XML Schema API operations only raise exceptions in "exceptional"
  25  * circumstances, i.e., when an operation is impossible to perform (either
  26  * for logical reasons, because data is lost, or because the implementation
  27  * has become unstable).
  28  * <p>Implementations should raise other exceptions under other circumstances.
  29  * <p>Some languages and object systems do not support the concept of
  30  * exceptions. For such systems, error conditions may be indicated using
  31  * native error reporting mechanisms. For some bindings, for example,
  32  * methods may return error codes similar to those listed in the
  33  * corresponding method descriptions.
  34  */
  35 public class XSException extends RuntimeException {
  36 
  37     /** Serialization version. */
  38     static final long serialVersionUID = 3111893084677917742L;
  39 
  40     public XSException(short code, String message) {
  41        super(message);
  42        this.code = code;
  43     }
  44     public short   code;
  45     // ExceptionCode
  46     /**
  47      * If the implementation does not support the requested type of object or
  48      * operation.
  49      */
  50     public static final short NOT_SUPPORTED_ERR         = 1;
  51     /**
  52      * If index or size is negative, or greater than the allowed value
  53      */
  54     public static final short INDEX_SIZE_ERR            = 2;
  55 
  56 }