Commit 8a5322c9 authored by Steven Murray's avatar Steven Murray
Browse files

Added the following exception:

    castor::exception::AlreadyInitialized
parent 174ce41f
......@@ -354,6 +354,7 @@ InstallNonExecFile(db/cnv/DbBaseCnv.hpp,$(BUILDHEADERSDIRHPP)/db/cnv,644)
InstallNonExecFile(db/ora/OraCnvSvc.hpp,$(BUILDHEADERSDIRHPP)/db/ora,644)
InstallNonExecFile(db/ora/OraCommonSvc.hpp,$(BUILDHEADERSDIRHPP)/db/ora,644)
InstallNonExecFile(exception/AlreadyInitialized.hpp,$(BUILDHEADERSDIRHPP)/exception,644)
InstallNonExecFile(exception/InvalidArgument.hpp,$(BUILDHEADERSDIRHPP)/exception,644)
InstallNonExecFile(exception/InvalidNbArguments.hpp,$(BUILDHEADERSDIRHPP)/exception,644)
InstallNonExecFile(exception/NoEntry.hpp,$(BUILDHEADERSDIRHPP)/exception,644)
......
/******************************************************************************
* AlreadyInitialized.cpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* 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.
*
*
*
*
* @author Sebastien Ponce
*****************************************************************************/
// Include Files
#include <errno.h>
#include "serrno.h"
#include "castor/exception/AlreadyInitialized.hpp"
// -----------------------------------------------------------------------
// Constructor
// -----------------------------------------------------------------------
castor::exception::AlreadyInitialized::AlreadyInitialized() :
castor::exception::Exception(SEALREADYINIT) {}
/******************************************************************************
* AlreadyInitialized.hpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* 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.
*
*
* Invalid argument exception
*
* @author Sebastien Ponce
*****************************************************************************/
#ifndef EXCEPTION_ALREADYINITIALIZED_HPP
#define EXCEPTION_ALREADYINITIALIZED_HPP 1
// Include Files
#include "castor/exception/Exception.hpp"
namespace castor {
namespace exception {
/**
* Invalid argument exception
*/
class AlreadyInitialized : public castor::exception::Exception {
public:
/**
* default constructor
*/
AlreadyInitialized();
};
} // end of namespace exception
} // end of namespace castor
#endif // EXCEPTION_ALREADYINITIALIZED_HPP
......@@ -33,6 +33,7 @@ set (COMMON_LIB_SRC_FILES
socket_timeout.c u64subr.c Cinitdaemon.c Cgetopt.c
Cregexp.c Cexportconf.c Csnprintf.c util.c
Csecloader.c castor1compat.c
../castor/exception/AlreadyInitialized.cpp
../castor/exception/Backtrace.cpp
../castor/exception/BadVersion.cpp
../castor/exception/Busy.cpp
......@@ -42,7 +43,7 @@ set (COMMON_LIB_SRC_FILES
../castor/exception/InvalidArgument.cpp
../castor/exception/InvalidConfigEntry.cpp
../castor/exception/InvalidConfiguration.cpp
../castor/exception/InvalidNbArguments.hpp
../castor/exception/InvalidNbArguments.cpp
../castor/exception/Internal.cpp
../castor/exception/Mismatch.cpp
../castor/exception/NotSupported.cpp
......
......@@ -18,6 +18,7 @@ COMMONLIB_OBJS = compat.o getacct.o getacctent.o getconfent.o \
socket_timeout.o u64subr.o Cinitdaemon.o Cgetopt.o \
Cregexp.o Cexportconf.o Csnprintf.o util.o \
Csecloader.o castor1compat.o \
../castor/exception/AlreadyInitialized.o \
../castor/exception/BadVersion.o \
../castor/exception/Busy.o \
../castor/exception/DismountFailed.o \
......
......@@ -69,6 +69,7 @@ char *sys_serrlist[SEMAXERR-SEBASEOFF+2]=
"Mismatch",
"Request failed",
"Invalid number of arguments",
"Already initialized",
"BAD ERROR NUMBER"
};
......
......@@ -21,6 +21,7 @@
%attr(0644,root,root) usr/include/castor/castor/dlf/Message.hpp
%attr(0644,root,root) usr/include/castor/castor/dlf/Param.hpp
%attr(0644,root,root) usr/include/castor/castor/dlf/TimeStamp.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/AlreadyInitialized.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/Communication.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/Exception.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/Internal.hpp
......
......@@ -80,8 +80,9 @@
#define SEMISMATCH SEBASEOFF+46 /* Mismatch */
#define SEREQUESTFAILED SEBASEOFF+47 /* Request failed */
#define SEINVALIDNBARGS SEBASEOFF+48 /* Invalid number of arguments */
#define SEALREADYINIT SEBASEOFF+49 /* Already initialized */
#define SEMAXERR SEBASEOFF+48 /* Maximum error number */
#define SEMAXERR SEBASEOFF+49 /* Maximum error number */
#define SERRNO (serrno - SEBASEOFF) /* User convenience */
/*
......
......@@ -199,6 +199,9 @@ The following error values might be returned by any package:
.TP
.B SEINVALIDNBARGS
(1048) Invalid number of arguments
.TP
.B SEALREADYINIT
(1049) Already initialized
.SH COPYTAPE ERRORS
None yet
......
......@@ -92,6 +92,7 @@ rununittests: $(RMC_OBJECTS) \
dlf_Dlf.o \
dlf_Param.o \
dlf_dlf_lib.o \
exception_AlreadyInitialized.o \
exception_Communication.o \
exception_DismountFailed.o \
exception_Exception.o \
......@@ -517,6 +518,13 @@ dlf_Param.o: $(ROOT_DIR)/castor/dlf/Param.cpp
dlf_dlf_lib.o: $(ROOT_DIR)/dlf/dlf_lib.c
gcc -g -pthread -c $(INCLUDE_OPS) -o $@ $^
exception_AlreadyInitialized.o: \
$(ROOT_DIR)/castor/exception/AlreadyInitialized.cpp
g++ $(COMMON_OPS) -c $(INCLUDE_OPS) -o $@ $^
exception_Communication.o: $(ROOT_DIR)/castor/exception/Communication.cpp
g++ $(COMMON_OPS) -c $(INCLUDE_OPS) -o $@ $^
exception_DismountFailed.o: $(ROOT_DIR)/castor/exception/DismountFailed.cpp
g++ $(COMMON_OPS) -c $(INCLUDE_OPS) -o $@ $^
......@@ -538,9 +546,6 @@ exception_NoEntry.o: $(ROOT_DIR)/castor/exception/NoEntry.cpp
exception_InvalidArgument.o: $(ROOT_DIR)/castor/exception/InvalidArgument.cpp
g++ $(COMMON_OPS) -c $(INCLUDE_OPS) -o $@ $^
exception_Communication.o: $(ROOT_DIR)/castor/exception/Communication.cpp
g++ $(COMMON_OPS) -c $(INCLUDE_OPS) -o $@ $^
exception_Internal.o: $(ROOT_DIR)/castor/exception/Internal.cpp
g++ $(COMMON_OPS) -c $(INCLUDE_OPS) -o $@ $^
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment