package com.dbxml.db.core;

/*
 * dbXML - Native XML Database
 * Copyright (C) 1999-2004  The dbXML Group, L.L.C.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: DBException.java,v 1.4 2004/02/12 00:17:56 bradford Exp $
 */

import com.dbxml.db.core.FaultCodes;
import com.dbxml.util.dbXMLException;

/**
 * A DBException is thrown by the database if an exception occurs in the
 * managing (creating, dropping) database objects such as Collections,
 * Indexes, and Extensions.
 */

public class DBException extends dbXMLException {
   private static final int DEFAULT_CODE = FaultCodes.GEN_UNKNOWN;
   private static final String DEFAULT_MSG = FaultCodes.getMessage(DEFAULT_CODE);

   public DBException() {
      super(DEFAULT_CODE, DEFAULT_MSG);
   }

   public DBException(Throwable wrapped) {
      super(DEFAULT_CODE, DEFAULT_MSG, wrapped);
   }

   public DBException(int faultCode) {
      super(faultCode, FaultCodes.getMessage(faultCode));
   }

   public DBException(int faultCode, Throwable wrapped) {
      super(faultCode, FaultCodes.getMessage(faultCode), wrapped);
   }

   public DBException(int faultCode, String message) {
      super(faultCode, message);
   }

   public DBException(int faultCode, String message, Throwable wrapped) {
      super(faultCode, message, wrapped);
   }
}
